From eefcd62d5b3f2f02b9a60e57591d3f2591ce6146 Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Mon, 18 May 2020 11:26:27 +0300 Subject: [PATCH] [Kotlin][Client] Added supporting Retrofit2(RxJava/RxJava2/Coroutines) (#5750) * Added support Retrofit2(RxJava/RxJava2/Coroutines) to Kotlin client code generator * Added generated samples for Retrofit2(RxJava/RxJava2/Coroutines) on Kotlin * Fixed generating retrofit2 without Rx/Coroutines * Fixed MultipartBody template, remove redundant space after MultipartBody.Part annotation * Fix documentation diff. * Fix generating build.gradle file for samples. Add dependencies for rxJava/rxJava2 and rx retrofit's adapter. * Update generated sample with rx dependencies * Update generated sample with coroutines * Update generated sample with RxJava 2 dependencies * Update and refactoring scripts for sample generation * Update generated sample code * revert changes by mistake * revert changes by mistake #2 * Fix return type for first RxJava * Add RxJavaCallAdapterFactory to ApiClient scheme for RxJava 1/2 * Fix script loggin * Update generated code for RxJava 1/2 * Fix kotlin.md documentation by script export_docs_generators.sh * Update Kotlin samples project in pom.xml * Revert "Update Kotlin samples project in pom.xml" This reverts commit 9de4d0ba * Fixed "" wrapping number types for annotation value Fixed generating polymorphic interfaces for Gson, interface fields can't be marked with @SerializedName annotation, it's enough to mark it in child model. Fixed instantiationTypes(array, list, map) for Kotlin generator * Update Kotlin samples project after last fixes * Update Kotlin samples project for kotlin-jvm-* * Update Kotlin readme.md documentations * Update Kotlin client sample changes * Fixed encoding braces for generics model * Update Kotlin client sample changes * Update Kotlin client sample after merge with master * Fixed adding empty braces for inherit from Map/Array * Update sample model after last fix with empty braces * Revert adding @SerializedName to Kotlin interface fields through @get:SerializedName as for Jackson * Update Kotlin client samples with adding @get:SerializedName --- bin/openapi3/kotlin-client-petstore-all.sh | 10 + .../kotlin-client-petstore-multiplatform.sh | 10 +- ...otlin-client-petstore-nullable-required.sh | 10 +- ...in-client-petstore-retrofit2-coroutines.sh | 37 + .../kotlin-client-petstore-retrofit2-rx.sh | 37 + .../kotlin-client-petstore-retrofit2-rx2.sh | 37 + bin/openapi3/kotlin-client-petstore.sh | 10 +- docs/generators/kotlin-server.md | 6 +- docs/generators/kotlin-spring.md | 6 +- docs/generators/kotlin-vertx.md | 6 +- docs/generators/kotlin.md | 9 +- .../languages/AbstractKotlinCodegen.java | 6 +- .../languages/KotlinClientCodegen.java | 89 +- .../kotlin-client/build.gradle.mustache | 14 + .../kotlin-client/data_class.mustache | 6 +- .../kotlin-client/interface_opt_var.mustache | 2 +- .../kotlin-client/interface_req_var.mustache | 2 +- .../libraries/jvm-retrofit2/api.mustache | 17 +- .../jvm-retrofit2/formParams.mustache | 2 +- .../infrastructure/ApiClient.kt.mustache | 12 + .../org/openapitools/client/models/Order.kt | 6 +- .../org/openapitools/client/models/Pet.kt | 6 +- .../org/openapitools/client/models/Order.kt | 6 +- .../org/openapitools/client/models/Pet.kt | 6 +- .../org/openapitools/client/apis/PetApi.kt | 2 +- .../.openapi-generator-ignore | 23 + .../.openapi-generator/VERSION | 1 + .../kotlin-jvm-retrofit2-coroutines/README.md | 173 ++++ .../build.gradle | 38 + .../docs/200Response.md | 11 + .../docs/AdditionalPropertiesClass.md | 11 + .../docs/Animal.md | 11 + .../docs/AnotherFakeApi.md | 56 ++ .../docs/ApiResponse.md | 12 + .../docs/ArrayOfArrayOfNumberOnly.md | 10 + .../docs/ArrayOfNumberOnly.md | 10 + .../docs/ArrayTest.md | 12 + .../docs/Capitalization.md | 15 + .../docs/Cat.md | 10 + .../docs/CatAllOf.md | 10 + .../docs/Category.md | 11 + .../docs/ClassModel.md | 10 + .../docs/Client.md | 10 + .../docs/DefaultApi.md | 50 ++ .../docs/Dog.md | 10 + .../docs/DogAllOf.md | 10 + .../docs/EnumArrays.md | 25 + .../docs/EnumClass.md | 14 + .../docs/EnumTest.md | 45 + .../docs/FakeApi.md | 776 ++++++++++++++++++ .../docs/FakeClassnameTags123Api.md | 59 ++ .../docs/FileSchemaTestClass.md | 11 + .../docs/Foo.md | 10 + .../docs/FormatTest.md | 24 + .../docs/HasOnlyReadOnly.md | 11 + .../docs/HealthCheckResult.md | 10 + .../docs/InlineObject.md | 11 + .../docs/InlineObject1.md | 11 + .../docs/InlineObject2.md | 25 + .../docs/InlineObject3.md | 23 + .../docs/InlineObject4.md | 11 + .../docs/InlineObject5.md | 11 + .../docs/InlineResponseDefault.md | 10 + .../docs/List.md | 10 + .../docs/MapTest.md | 20 + ...dPropertiesAndAdditionalPropertiesClass.md | 12 + .../docs/Name.md | 13 + .../docs/NullableClass.md | 21 + .../docs/NumberOnly.md | 10 + .../docs/Order.md | 22 + .../docs/OuterComposite.md | 12 + .../docs/OuterEnum.md | 14 + .../docs/OuterEnumDefaultValue.md | 14 + .../docs/OuterEnumInteger.md | 14 + .../docs/OuterEnumIntegerDefaultValue.md | 14 + .../docs/Pet.md | 22 + .../docs/PetApi.md | 457 +++++++++++ .../docs/ReadOnlyFirst.md | 11 + .../docs/Return.md | 10 + .../docs/SpecialModelName.md | 10 + .../docs/StoreApi.md | 196 +++++ .../docs/Tag.md | 11 + .../docs/User.md | 17 + .../docs/UserApi.md | 376 +++++++++ .../settings.gradle | 2 + .../client/apis/AnotherFakeApi.kt | 15 + .../openapitools/client/apis/DefaultApi.kt | 15 + .../org/openapitools/client/apis/FakeApi.kt | 65 ++ .../client/apis/FakeClassnameTags123Api.kt | 15 + .../org/openapitools/client/apis/PetApi.kt | 44 + .../org/openapitools/client/apis/StoreApi.kt | 24 + .../org/openapitools/client/apis/UserApi.kt | 36 + .../client/infrastructure/ApiClient.kt | 40 + .../client/infrastructure/ByteArrayAdapter.kt | 33 + .../infrastructure/CollectionFormats.kt | 56 ++ .../client/infrastructure/DateAdapter.kt | 37 + .../client/infrastructure/LocalDateAdapter.kt | 35 + .../infrastructure/LocalDateTimeAdapter.kt | 35 + .../infrastructure/OffsetDateTimeAdapter.kt | 35 + .../client/infrastructure/Serializer.kt | 24 + .../models/AdditionalPropertiesClass.kt | 34 + .../org/openapitools/client/models/Animal.kt | 33 + .../openapitools/client/models/ApiResponse.kt | 37 + .../client/models/ArrayOfArrayOfNumberOnly.kt | 31 + .../client/models/ArrayOfNumberOnly.kt | 31 + .../openapitools/client/models/ArrayTest.kt | 38 + .../client/models/Capitalization.kt | 47 ++ .../org/openapitools/client/models/Cat.kt | 39 + .../openapitools/client/models/CatAllOf.kt | 31 + .../openapitools/client/models/Category.kt | 34 + .../openapitools/client/models/ClassModel.kt | 31 + .../org/openapitools/client/models/Client.kt | 31 + .../org/openapitools/client/models/Dog.kt | 39 + .../openapitools/client/models/DogAllOf.kt | 31 + .../openapitools/client/models/EnumArrays.kt | 52 ++ .../openapitools/client/models/EnumClass.kt | 47 ++ .../openapitools/client/models/EnumTest.kt | 94 +++ .../client/models/FileSchemaTestClass.kt | 34 + .../org/openapitools/client/models/Foo.kt | 31 + .../openapitools/client/models/FormatTest.kt | 75 ++ .../client/models/HasOnlyReadOnly.kt | 34 + .../client/models/HealthCheckResult.kt | 31 + .../client/models/InlineObject.kt | 36 + .../client/models/InlineObject1.kt | 36 + .../client/models/InlineObject2.kt | 55 ++ .../client/models/InlineObject3.kt | 84 ++ .../client/models/InlineObject4.kt | 36 + .../client/models/InlineObject5.kt | 36 + .../client/models/InlineResponseDefault.kt | 32 + .../org/openapitools/client/models/List.kt | 31 + .../org/openapitools/client/models/MapTest.kt | 49 ++ ...dPropertiesAndAdditionalPropertiesClass.kt | 38 + .../client/models/Model200Response.kt | 34 + .../org/openapitools/client/models/Name.kt | 40 + .../client/models/NullableClass.kt | 64 ++ .../openapitools/client/models/NumberOnly.kt | 31 + .../org/openapitools/client/models/Order.kt | 57 ++ .../client/models/OuterComposite.kt | 37 + .../openapitools/client/models/OuterEnum.kt | 47 ++ .../client/models/OuterEnumDefaultValue.kt | 47 ++ .../client/models/OuterEnumInteger.kt | 47 ++ .../models/OuterEnumIntegerDefaultValue.kt | 47 ++ .../org/openapitools/client/models/Pet.kt | 59 ++ .../client/models/ReadOnlyFirst.kt | 34 + .../org/openapitools/client/models/Return.kt | 31 + .../client/models/SpecialModelname.kt | 31 + .../org/openapitools/client/models/Tag.kt | 34 + .../org/openapitools/client/models/User.kt | 53 ++ .../.openapi-generator-ignore | 23 + .../.openapi-generator/VERSION | 1 + .../kotlin-jvm-retrofit2-rx/README.md | 173 ++++ .../kotlin-jvm-retrofit2-rx/build.gradle | 41 + .../docs/200Response.md | 11 + .../docs/AdditionalPropertiesClass.md | 11 + .../kotlin-jvm-retrofit2-rx/docs/Animal.md | 11 + .../docs/AnotherFakeApi.md | 56 ++ .../docs/ApiResponse.md | 12 + .../docs/ArrayOfArrayOfNumberOnly.md | 10 + .../docs/ArrayOfNumberOnly.md | 10 + .../kotlin-jvm-retrofit2-rx/docs/ArrayTest.md | 12 + .../docs/Capitalization.md | 15 + .../kotlin-jvm-retrofit2-rx/docs/Cat.md | 10 + .../kotlin-jvm-retrofit2-rx/docs/CatAllOf.md | 10 + .../kotlin-jvm-retrofit2-rx/docs/Category.md | 11 + .../docs/ClassModel.md | 10 + .../kotlin-jvm-retrofit2-rx/docs/Client.md | 10 + .../docs/DefaultApi.md | 50 ++ .../kotlin-jvm-retrofit2-rx/docs/Dog.md | 10 + .../kotlin-jvm-retrofit2-rx/docs/DogAllOf.md | 10 + .../docs/EnumArrays.md | 25 + .../kotlin-jvm-retrofit2-rx/docs/EnumClass.md | 14 + .../kotlin-jvm-retrofit2-rx/docs/EnumTest.md | 45 + .../kotlin-jvm-retrofit2-rx/docs/FakeApi.md | 776 ++++++++++++++++++ .../docs/FakeClassnameTags123Api.md | 59 ++ .../docs/FileSchemaTestClass.md | 11 + .../kotlin-jvm-retrofit2-rx/docs/Foo.md | 10 + .../docs/FormatTest.md | 24 + .../docs/HasOnlyReadOnly.md | 11 + .../docs/HealthCheckResult.md | 10 + .../docs/InlineObject.md | 11 + .../docs/InlineObject1.md | 11 + .../docs/InlineObject2.md | 25 + .../docs/InlineObject3.md | 23 + .../docs/InlineObject4.md | 11 + .../docs/InlineObject5.md | 11 + .../docs/InlineResponseDefault.md | 10 + .../kotlin-jvm-retrofit2-rx/docs/List.md | 10 + .../kotlin-jvm-retrofit2-rx/docs/MapTest.md | 20 + ...dPropertiesAndAdditionalPropertiesClass.md | 12 + .../kotlin-jvm-retrofit2-rx/docs/Name.md | 13 + .../docs/NullableClass.md | 21 + .../docs/NumberOnly.md | 10 + .../kotlin-jvm-retrofit2-rx/docs/Order.md | 22 + .../docs/OuterComposite.md | 12 + .../kotlin-jvm-retrofit2-rx/docs/OuterEnum.md | 14 + .../docs/OuterEnumDefaultValue.md | 14 + .../docs/OuterEnumInteger.md | 14 + .../docs/OuterEnumIntegerDefaultValue.md | 14 + .../kotlin-jvm-retrofit2-rx/docs/Pet.md | 22 + .../kotlin-jvm-retrofit2-rx/docs/PetApi.md | 457 +++++++++++ .../docs/ReadOnlyFirst.md | 11 + .../kotlin-jvm-retrofit2-rx/docs/Return.md | 10 + .../docs/SpecialModelName.md | 10 + .../kotlin-jvm-retrofit2-rx/docs/StoreApi.md | 196 +++++ .../kotlin-jvm-retrofit2-rx/docs/Tag.md | 11 + .../kotlin-jvm-retrofit2-rx/docs/User.md | 17 + .../kotlin-jvm-retrofit2-rx/docs/UserApi.md | 376 +++++++++ .../kotlin-jvm-retrofit2-rx/settings.gradle | 2 + .../client/apis/AnotherFakeApi.kt | 16 + .../openapitools/client/apis/DefaultApi.kt | 16 + .../org/openapitools/client/apis/FakeApi.kt | 66 ++ .../client/apis/FakeClassnameTags123Api.kt | 16 + .../org/openapitools/client/apis/PetApi.kt | 45 + .../org/openapitools/client/apis/StoreApi.kt | 25 + .../org/openapitools/client/apis/UserApi.kt | 37 + .../client/infrastructure/ApiClient.kt | 42 + .../client/infrastructure/ByteArrayAdapter.kt | 33 + .../infrastructure/CollectionFormats.kt | 56 ++ .../client/infrastructure/DateAdapter.kt | 37 + .../client/infrastructure/LocalDateAdapter.kt | 35 + .../infrastructure/LocalDateTimeAdapter.kt | 35 + .../infrastructure/OffsetDateTimeAdapter.kt | 35 + .../client/infrastructure/Serializer.kt | 24 + .../models/AdditionalPropertiesClass.kt | 34 + .../org/openapitools/client/models/Animal.kt | 33 + .../openapitools/client/models/ApiResponse.kt | 37 + .../client/models/ArrayOfArrayOfNumberOnly.kt | 31 + .../client/models/ArrayOfNumberOnly.kt | 31 + .../openapitools/client/models/ArrayTest.kt | 38 + .../client/models/Capitalization.kt | 47 ++ .../org/openapitools/client/models/Cat.kt | 39 + .../openapitools/client/models/CatAllOf.kt | 31 + .../openapitools/client/models/Category.kt | 34 + .../openapitools/client/models/ClassModel.kt | 31 + .../org/openapitools/client/models/Client.kt | 31 + .../org/openapitools/client/models/Dog.kt | 39 + .../openapitools/client/models/DogAllOf.kt | 31 + .../openapitools/client/models/EnumArrays.kt | 52 ++ .../openapitools/client/models/EnumClass.kt | 47 ++ .../openapitools/client/models/EnumTest.kt | 94 +++ .../client/models/FileSchemaTestClass.kt | 34 + .../org/openapitools/client/models/Foo.kt | 31 + .../openapitools/client/models/FormatTest.kt | 75 ++ .../client/models/HasOnlyReadOnly.kt | 34 + .../client/models/HealthCheckResult.kt | 31 + .../client/models/InlineObject.kt | 36 + .../client/models/InlineObject1.kt | 36 + .../client/models/InlineObject2.kt | 55 ++ .../client/models/InlineObject3.kt | 84 ++ .../client/models/InlineObject4.kt | 36 + .../client/models/InlineObject5.kt | 36 + .../client/models/InlineResponseDefault.kt | 32 + .../org/openapitools/client/models/List.kt | 31 + .../org/openapitools/client/models/MapTest.kt | 49 ++ ...dPropertiesAndAdditionalPropertiesClass.kt | 38 + .../client/models/Model200Response.kt | 34 + .../org/openapitools/client/models/Name.kt | 40 + .../client/models/NullableClass.kt | 64 ++ .../openapitools/client/models/NumberOnly.kt | 31 + .../org/openapitools/client/models/Order.kt | 57 ++ .../client/models/OuterComposite.kt | 37 + .../openapitools/client/models/OuterEnum.kt | 47 ++ .../client/models/OuterEnumDefaultValue.kt | 47 ++ .../client/models/OuterEnumInteger.kt | 47 ++ .../models/OuterEnumIntegerDefaultValue.kt | 47 ++ .../org/openapitools/client/models/Pet.kt | 59 ++ .../client/models/ReadOnlyFirst.kt | 34 + .../org/openapitools/client/models/Return.kt | 31 + .../client/models/SpecialModelname.kt | 31 + .../org/openapitools/client/models/Tag.kt | 34 + .../org/openapitools/client/models/User.kt | 53 ++ .../.openapi-generator-ignore | 23 + .../.openapi-generator/VERSION | 1 + .../kotlin-jvm-retrofit2-rx2/README.md | 173 ++++ .../kotlin-jvm-retrofit2-rx2/build.gradle | 41 + .../docs/200Response.md | 11 + .../docs/AdditionalPropertiesClass.md | 11 + .../kotlin-jvm-retrofit2-rx2/docs/Animal.md | 11 + .../docs/AnotherFakeApi.md | 56 ++ .../docs/ApiResponse.md | 12 + .../docs/ArrayOfArrayOfNumberOnly.md | 10 + .../docs/ArrayOfNumberOnly.md | 10 + .../docs/ArrayTest.md | 12 + .../docs/Capitalization.md | 15 + .../kotlin-jvm-retrofit2-rx2/docs/Cat.md | 10 + .../kotlin-jvm-retrofit2-rx2/docs/CatAllOf.md | 10 + .../kotlin-jvm-retrofit2-rx2/docs/Category.md | 11 + .../docs/ClassModel.md | 10 + .../kotlin-jvm-retrofit2-rx2/docs/Client.md | 10 + .../docs/DefaultApi.md | 50 ++ .../kotlin-jvm-retrofit2-rx2/docs/Dog.md | 10 + .../kotlin-jvm-retrofit2-rx2/docs/DogAllOf.md | 10 + .../docs/EnumArrays.md | 25 + .../docs/EnumClass.md | 14 + .../kotlin-jvm-retrofit2-rx2/docs/EnumTest.md | 45 + .../kotlin-jvm-retrofit2-rx2/docs/FakeApi.md | 776 ++++++++++++++++++ .../docs/FakeClassnameTags123Api.md | 59 ++ .../docs/FileSchemaTestClass.md | 11 + .../kotlin-jvm-retrofit2-rx2/docs/Foo.md | 10 + .../docs/FormatTest.md | 24 + .../docs/HasOnlyReadOnly.md | 11 + .../docs/HealthCheckResult.md | 10 + .../docs/InlineObject.md | 11 + .../docs/InlineObject1.md | 11 + .../docs/InlineObject2.md | 25 + .../docs/InlineObject3.md | 23 + .../docs/InlineObject4.md | 11 + .../docs/InlineObject5.md | 11 + .../docs/InlineResponseDefault.md | 10 + .../kotlin-jvm-retrofit2-rx2/docs/List.md | 10 + .../kotlin-jvm-retrofit2-rx2/docs/MapTest.md | 20 + ...dPropertiesAndAdditionalPropertiesClass.md | 12 + .../kotlin-jvm-retrofit2-rx2/docs/Name.md | 13 + .../docs/NullableClass.md | 21 + .../docs/NumberOnly.md | 10 + .../kotlin-jvm-retrofit2-rx2/docs/Order.md | 22 + .../docs/OuterComposite.md | 12 + .../docs/OuterEnum.md | 14 + .../docs/OuterEnumDefaultValue.md | 14 + .../docs/OuterEnumInteger.md | 14 + .../docs/OuterEnumIntegerDefaultValue.md | 14 + .../kotlin-jvm-retrofit2-rx2/docs/Pet.md | 22 + .../kotlin-jvm-retrofit2-rx2/docs/PetApi.md | 457 +++++++++++ .../docs/ReadOnlyFirst.md | 11 + .../kotlin-jvm-retrofit2-rx2/docs/Return.md | 10 + .../docs/SpecialModelName.md | 10 + .../kotlin-jvm-retrofit2-rx2/docs/StoreApi.md | 196 +++++ .../kotlin-jvm-retrofit2-rx2/docs/Tag.md | 11 + .../kotlin-jvm-retrofit2-rx2/docs/User.md | 17 + .../kotlin-jvm-retrofit2-rx2/docs/UserApi.md | 376 +++++++++ .../kotlin-jvm-retrofit2-rx2/settings.gradle | 2 + .../client/apis/AnotherFakeApi.kt | 17 + .../openapitools/client/apis/DefaultApi.kt | 17 + .../org/openapitools/client/apis/FakeApi.kt | 67 ++ .../client/apis/FakeClassnameTags123Api.kt | 17 + .../org/openapitools/client/apis/PetApi.kt | 46 ++ .../org/openapitools/client/apis/StoreApi.kt | 26 + .../org/openapitools/client/apis/UserApi.kt | 38 + .../client/infrastructure/ApiClient.kt | 42 + .../client/infrastructure/ByteArrayAdapter.kt | 33 + .../infrastructure/CollectionFormats.kt | 56 ++ .../client/infrastructure/DateAdapter.kt | 37 + .../client/infrastructure/LocalDateAdapter.kt | 35 + .../infrastructure/LocalDateTimeAdapter.kt | 35 + .../infrastructure/OffsetDateTimeAdapter.kt | 35 + .../client/infrastructure/Serializer.kt | 24 + .../models/AdditionalPropertiesClass.kt | 34 + .../org/openapitools/client/models/Animal.kt | 33 + .../openapitools/client/models/ApiResponse.kt | 37 + .../client/models/ArrayOfArrayOfNumberOnly.kt | 31 + .../client/models/ArrayOfNumberOnly.kt | 31 + .../openapitools/client/models/ArrayTest.kt | 38 + .../client/models/Capitalization.kt | 47 ++ .../org/openapitools/client/models/Cat.kt | 39 + .../openapitools/client/models/CatAllOf.kt | 31 + .../openapitools/client/models/Category.kt | 34 + .../openapitools/client/models/ClassModel.kt | 31 + .../org/openapitools/client/models/Client.kt | 31 + .../org/openapitools/client/models/Dog.kt | 39 + .../openapitools/client/models/DogAllOf.kt | 31 + .../openapitools/client/models/EnumArrays.kt | 52 ++ .../openapitools/client/models/EnumClass.kt | 47 ++ .../openapitools/client/models/EnumTest.kt | 94 +++ .../client/models/FileSchemaTestClass.kt | 34 + .../org/openapitools/client/models/Foo.kt | 31 + .../openapitools/client/models/FormatTest.kt | 75 ++ .../client/models/HasOnlyReadOnly.kt | 34 + .../client/models/HealthCheckResult.kt | 31 + .../client/models/InlineObject.kt | 36 + .../client/models/InlineObject1.kt | 36 + .../client/models/InlineObject2.kt | 55 ++ .../client/models/InlineObject3.kt | 84 ++ .../client/models/InlineObject4.kt | 36 + .../client/models/InlineObject5.kt | 36 + .../client/models/InlineResponseDefault.kt | 32 + .../org/openapitools/client/models/List.kt | 31 + .../org/openapitools/client/models/MapTest.kt | 49 ++ ...dPropertiesAndAdditionalPropertiesClass.kt | 38 + .../client/models/Model200Response.kt | 34 + .../org/openapitools/client/models/Name.kt | 40 + .../client/models/NullableClass.kt | 64 ++ .../openapitools/client/models/NumberOnly.kt | 31 + .../org/openapitools/client/models/Order.kt | 57 ++ .../client/models/OuterComposite.kt | 37 + .../openapitools/client/models/OuterEnum.kt | 47 ++ .../client/models/OuterEnumDefaultValue.kt | 47 ++ .../client/models/OuterEnumInteger.kt | 47 ++ .../models/OuterEnumIntegerDefaultValue.kt | 47 ++ .../org/openapitools/client/models/Pet.kt | 59 ++ .../client/models/ReadOnlyFirst.kt | 34 + .../org/openapitools/client/models/Return.kt | 31 + .../client/models/SpecialModelname.kt | 31 + .../org/openapitools/client/models/Tag.kt | 34 + .../org/openapitools/client/models/User.kt | 53 ++ .../.openapi-generator/VERSION | 2 +- .../petstore/kotlin-multiplatform/README.md | 6 + .../kotlin-multiplatform/docs/Category.md | 2 +- .../kotlin-multiplatform/docs/EnumTest.md | 16 +- .../kotlin-multiplatform/docs/FakeApi.md | 49 ++ .../kotlin-multiplatform/docs/FormatTest.md | 8 +- .../docs/InlineObject3.md | 8 +- .../docs/InlineObject5.md | 2 +- .../kotlin-multiplatform/docs/MapTest.md | 4 +- .../petstore/kotlin-multiplatform/docs/Pet.md | 4 +- .../org/openapitools/client/apis/FakeApi.kt | 38 + .../client/infrastructure/ApiClient.kt | 1 + .../models/AdditionalPropertiesClass.kt | 4 +- .../org/openapitools/client/models/Animal.kt | 9 +- .../openapitools/client/models/ApiResponse.kt | 4 +- .../client/models/ArrayOfArrayOfNumberOnly.kt | 4 +- .../client/models/ArrayOfNumberOnly.kt | 4 +- .../openapitools/client/models/ArrayTest.kt | 4 +- .../client/models/Capitalization.kt | 4 +- .../org/openapitools/client/models/Cat.kt | 12 +- .../openapitools/client/models/CatAllOf.kt | 4 +- .../openapitools/client/models/Category.kt | 6 +- .../openapitools/client/models/ClassModel.kt | 4 +- .../org/openapitools/client/models/Client.kt | 4 +- .../org/openapitools/client/models/Dog.kt | 12 +- .../openapitools/client/models/DogAllOf.kt | 4 +- .../openapitools/client/models/EnumArrays.kt | 4 +- .../openapitools/client/models/EnumClass.kt | 8 + .../openapitools/client/models/EnumTest.kt | 30 +- .../client/models/FileSchemaTestClass.kt | 4 +- .../org/openapitools/client/models/Foo.kt | 4 +- .../openapitools/client/models/FormatTest.kt | 12 +- .../client/models/HasOnlyReadOnly.kt | 4 +- .../client/models/HealthCheckResult.kt | 4 +- .../client/models/InlineObject.kt | 4 +- .../client/models/InlineObject1.kt | 4 +- .../client/models/InlineObject2.kt | 4 +- .../client/models/InlineObject3.kt | 12 +- .../client/models/InlineObject4.kt | 4 +- .../client/models/InlineObject5.kt | 6 +- .../client/models/InlineResponseDefault.kt | 4 +- .../org/openapitools/client/models/List.kt | 4 +- .../org/openapitools/client/models/MapTest.kt | 6 +- ...dPropertiesAndAdditionalPropertiesClass.kt | 4 +- .../client/models/Model200Response.kt | 4 +- .../org/openapitools/client/models/Name.kt | 4 +- .../client/models/NullableClass.kt | 4 +- .../openapitools/client/models/NumberOnly.kt | 4 +- .../org/openapitools/client/models/Order.kt | 4 +- .../client/models/OuterComposite.kt | 4 +- .../openapitools/client/models/OuterEnum.kt | 8 + .../client/models/OuterEnumDefaultValue.kt | 8 + .../client/models/OuterEnumInteger.kt | 8 + .../models/OuterEnumIntegerDefaultValue.kt | 8 + .../org/openapitools/client/models/Pet.kt | 8 +- .../client/models/ReadOnlyFirst.kt | 4 +- .../org/openapitools/client/models/Return.kt | 4 +- .../client/models/SpecialModelname.kt | 4 +- .../org/openapitools/client/models/Tag.kt | 4 +- .../org/openapitools/client/models/User.kt | 4 +- .../kotlin/.openapi-generator/VERSION | 2 +- .../openapi3/client/petstore/kotlin/README.md | 6 + .../client/petstore/kotlin/build.gradle | 14 +- .../client/petstore/kotlin/docs/Category.md | 2 +- .../client/petstore/kotlin/docs/EnumTest.md | 16 +- .../client/petstore/kotlin/docs/FakeApi.md | 53 +- .../client/petstore/kotlin/docs/FormatTest.md | 10 +- .../petstore/kotlin/docs/InlineObject3.md | 10 +- .../petstore/kotlin/docs/InlineObject5.md | 2 +- .../client/petstore/kotlin/docs/MapTest.md | 4 +- ...dPropertiesAndAdditionalPropertiesClass.md | 2 +- .../petstore/kotlin/docs/NullableClass.md | 2 +- .../client/petstore/kotlin/docs/Order.md | 2 +- .../client/petstore/kotlin/docs/Pet.md | 4 +- .../client/apis/AnotherFakeApi.kt | 28 +- .../openapitools/client/apis/DefaultApi.kt | 28 +- .../org/openapitools/client/apis/FakeApi.kt | 350 ++++++-- .../client/apis/FakeClassnameTags123Api.kt | 28 +- .../org/openapitools/client/apis/PetApi.kt | 192 +++-- .../org/openapitools/client/apis/StoreApi.kt | 86 +- .../org/openapitools/client/apis/UserApi.kt | 156 +++- .../client/infrastructure/ApiClient.kt | 93 ++- .../ApiInfrastructureResponse.kt | 5 +- .../client/infrastructure/ByteArrayAdapter.kt | 2 +- .../client/infrastructure/Errors.kt | 28 +- .../infrastructure/OffsetDateTimeAdapter.kt | 19 + .../client/infrastructure/Serializer.kt | 9 +- .../models/AdditionalPropertiesClass.kt | 6 +- .../org/openapitools/client/models/Animal.kt | 15 +- .../openapitools/client/models/ApiResponse.kt | 6 +- .../client/models/ArrayOfArrayOfNumberOnly.kt | 6 +- .../client/models/ArrayOfNumberOnly.kt | 6 +- .../openapitools/client/models/ArrayTest.kt | 6 +- .../client/models/Capitalization.kt | 6 +- .../org/openapitools/client/models/Cat.kt | 16 +- .../openapitools/client/models/CatAllOf.kt | 6 +- .../openapitools/client/models/Category.kt | 8 +- .../openapitools/client/models/ClassModel.kt | 6 +- .../org/openapitools/client/models/Client.kt | 6 +- .../org/openapitools/client/models/Dog.kt | 16 +- .../openapitools/client/models/DogAllOf.kt | 6 +- .../openapitools/client/models/EnumArrays.kt | 6 +- .../openapitools/client/models/EnumClass.kt | 8 + .../openapitools/client/models/EnumTest.kt | 36 +- .../client/models/FileSchemaTestClass.kt | 6 +- .../org/openapitools/client/models/Foo.kt | 6 +- .../openapitools/client/models/FormatTest.kt | 16 +- .../client/models/HasOnlyReadOnly.kt | 6 +- .../client/models/HealthCheckResult.kt | 6 +- .../client/models/InlineObject.kt | 6 +- .../client/models/InlineObject1.kt | 6 +- .../client/models/InlineObject2.kt | 6 +- .../client/models/InlineObject3.kt | 16 +- .../client/models/InlineObject4.kt | 6 +- .../client/models/InlineObject5.kt | 8 +- .../client/models/InlineResponseDefault.kt | 6 +- .../org/openapitools/client/models/List.kt | 6 +- .../org/openapitools/client/models/MapTest.kt | 8 +- ...dPropertiesAndAdditionalPropertiesClass.kt | 8 +- .../client/models/Model200Response.kt | 6 +- .../org/openapitools/client/models/Name.kt | 6 +- .../client/models/NullableClass.kt | 8 +- .../openapitools/client/models/NumberOnly.kt | 6 +- .../org/openapitools/client/models/Order.kt | 8 +- .../client/models/OuterComposite.kt | 6 +- .../openapitools/client/models/OuterEnum.kt | 8 + .../client/models/OuterEnumDefaultValue.kt | 8 + .../client/models/OuterEnumInteger.kt | 8 + .../models/OuterEnumIntegerDefaultValue.kt | 8 + .../org/openapitools/client/models/Pet.kt | 10 +- .../client/models/ReadOnlyFirst.kt | 6 +- .../org/openapitools/client/models/Return.kt | 6 +- .../client/models/SpecialModelname.kt | 6 +- .../org/openapitools/client/models/Tag.kt | 6 +- .../org/openapitools/client/models/User.kt | 6 +- 529 files changed, 17828 insertions(+), 725 deletions(-) create mode 100755 bin/openapi3/kotlin-client-petstore-all.sh create mode 100755 bin/openapi3/kotlin-client-petstore-retrofit2-coroutines.sh create mode 100755 bin/openapi3/kotlin-client-petstore-retrofit2-rx.sh create mode 100755 bin/openapi3/kotlin-client-petstore-retrofit2-rx2.sh create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/README.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/build.gradle create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/200Response.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/AdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Animal.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/AnotherFakeApi.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ApiResponse.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ArrayTest.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Capitalization.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Cat.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/CatAllOf.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Category.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ClassModel.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Client.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/DefaultApi.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Dog.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/DogAllOf.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/EnumArrays.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/EnumClass.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/EnumTest.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FakeApi.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FakeClassnameTags123Api.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FileSchemaTestClass.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Foo.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FormatTest.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/HasOnlyReadOnly.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/HealthCheckResult.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject1.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject2.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject3.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject4.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject5.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineResponseDefault.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/List.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/MapTest.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Name.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/NullableClass.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/NumberOnly.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Order.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterComposite.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterEnum.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterEnumDefaultValue.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterEnumInteger.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterEnumIntegerDefaultValue.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Pet.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/PetApi.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ReadOnlyFirst.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Return.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/SpecialModelName.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/StoreApi.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Tag.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/User.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/UserApi.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/settings.gradle create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Animal.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Capitalization.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Cat.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ClassModel.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Client.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Dog.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/EnumClass.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/EnumTest.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Foo.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/FormatTest.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/List.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/MapTest.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Model200Response.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Name.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/NullableClass.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Return.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/README.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/build.gradle create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/200Response.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/AdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Animal.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/AnotherFakeApi.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ApiResponse.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ArrayTest.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Capitalization.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Cat.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/CatAllOf.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Category.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ClassModel.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Client.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/DefaultApi.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Dog.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/DogAllOf.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/EnumArrays.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/EnumClass.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/EnumTest.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FakeApi.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FakeClassnameTags123Api.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FileSchemaTestClass.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Foo.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FormatTest.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/HasOnlyReadOnly.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/HealthCheckResult.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject1.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject2.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject3.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject4.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject5.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineResponseDefault.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/List.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/MapTest.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Name.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/NullableClass.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/NumberOnly.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Order.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterComposite.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterEnum.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterEnumDefaultValue.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterEnumInteger.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterEnumIntegerDefaultValue.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Pet.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/PetApi.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ReadOnlyFirst.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Return.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/SpecialModelName.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/StoreApi.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Tag.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/User.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/UserApi.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/settings.gradle create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/PetApi.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/UserApi.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Animal.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Capitalization.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Cat.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Category.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ClassModel.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Client.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Dog.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/EnumClass.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/EnumTest.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Foo.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/FormatTest.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/List.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/MapTest.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Model200Response.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Name.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/NullableClass.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Order.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Pet.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Return.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Tag.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/User.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/README.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/build.gradle create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/200Response.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/AdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Animal.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/AnotherFakeApi.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ApiResponse.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ArrayTest.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Capitalization.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Cat.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/CatAllOf.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Category.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ClassModel.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Client.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/DefaultApi.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Dog.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/DogAllOf.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/EnumArrays.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/EnumClass.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/EnumTest.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FakeApi.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FakeClassnameTags123Api.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FileSchemaTestClass.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Foo.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FormatTest.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/HasOnlyReadOnly.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/HealthCheckResult.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject1.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject2.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject3.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject4.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject5.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineResponseDefault.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/List.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/MapTest.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Name.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/NullableClass.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/NumberOnly.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Order.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterComposite.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterEnum.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterEnumDefaultValue.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterEnumInteger.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterEnumIntegerDefaultValue.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Pet.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/PetApi.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ReadOnlyFirst.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Return.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/SpecialModelName.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/StoreApi.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Tag.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/User.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/UserApi.md create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/settings.gradle create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/PetApi.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/UserApi.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Animal.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Capitalization.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Cat.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Category.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ClassModel.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Client.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Dog.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/EnumClass.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/EnumTest.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Foo.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/FormatTest.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/List.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/MapTest.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Model200Response.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Name.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/NullableClass.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Order.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Pet.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Return.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Tag.kt create mode 100644 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/User.kt create mode 100644 samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt diff --git a/bin/openapi3/kotlin-client-petstore-all.sh b/bin/openapi3/kotlin-client-petstore-all.sh new file mode 100755 index 00000000000..5be9f089bf2 --- /dev/null +++ b/bin/openapi3/kotlin-client-petstore-all.sh @@ -0,0 +1,10 @@ +#!/bin/sh + + +./bin/openapi3/kotlin-client-petstore.sh +./bin/openapi3/kotlin-client-petstore-multiplatform.sh +./bin/openapi3/kotlin-client-petstore-nullable-required.sh +./bin/openapi3/kotlin-client-petstore-retrofit2-coroutines.sh +./bin/openapi3/kotlin-client-petstore-retrofit2-rx.sh +./bin/openapi3/kotlin-client-petstore-retrofit2-rx2.sh + diff --git a/bin/openapi3/kotlin-client-petstore-multiplatform.sh b/bin/openapi3/kotlin-client-petstore-multiplatform.sh index 913f73ef1d8..9ea03583944 100755 --- a/bin/openapi3/kotlin-client-petstore-multiplatform.sh +++ b/bin/openapi3/kotlin-client-petstore-multiplatform.sh @@ -25,11 +25,13 @@ then mvn clean package fi -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-client-petstore-multiplatform --library multiplatform -o samples/openapi3/client/petstore/kotlin-multiplatform $@" +samplePath="samples/openapi3/client/petstore/kotlin-multiplatform" -echo "Cleaning previously generated files if any from samples/openapi3/client/petstore/kotlin-multiplatform" -rm -rf samples/openapi3/client/petstore/kotlin-multiplatform +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-client-petstore-multiplatform --library multiplatform -o $samplePath $@" + +echo "Cleaning previously generated files if any from $samplePath" +rm -rf $samplePath echo "Generating Kotling client..." java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/kotlin-client-petstore-nullable-required.sh b/bin/openapi3/kotlin-client-petstore-nullable-required.sh index 18c09a54cac..a59f31ecb54 100644 --- a/bin/openapi3/kotlin-client-petstore-nullable-required.sh +++ b/bin/openapi3/kotlin-client-petstore-nullable-required.sh @@ -25,11 +25,13 @@ then mvn clean package fi -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-nullable-required.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-nullable-required --additional-properties allowRequiredAsNullable=true -o samples/openapi3/client/petstore/kotlin-nullable-required $@" +samplePath="samples/openapi3/client/petstore/kotlin-nullable-required" -echo "Cleaning previously generated files if any from samples/openapi3/client/petstore/kotlin-nullable-required" -rm -rf samples/openapi3/client/petstore/kotlin-nullable-required +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-nullable-required.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-nullable-required --additional-properties allowRequiredAsNullable=true -o $samplePath $@" + +echo "Cleaning previously generated files if any from $samplePath" +rm -rf $samplePath echo "Generating Kotling client..." java $JAVA_OPTS -jar $executable $ags \ No newline at end of file diff --git a/bin/openapi3/kotlin-client-petstore-retrofit2-coroutines.sh b/bin/openapi3/kotlin-client-petstore-retrofit2-coroutines.sh new file mode 100755 index 00000000000..0c45c5584df --- /dev/null +++ b/bin/openapi3/kotlin-client-petstore-retrofit2-coroutines.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +while [ -h "$SCRIPT" ] ; do + ls=$(ls -ld "$SCRIPT") + link=$(expr "$ls" : '.*-> \(.*\)$') + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=$(dirname "$SCRIPT")/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=$(dirname "$SCRIPT")/.. + APP_DIR=$(cd "${APP_DIR}"; pwd) +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +samplePath="samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines" + +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-coroutines-client --library jvm-retrofit2 --additional-properties serializationLibrary=gson,dateLibrary=java8,serializableModel=true,useCoroutines=true -o $samplePath $@" + +echo "Cleaning previously generated files if any from $samplePath" +rm -rf $samplePath + +echo "Generating Kotling client..." +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/kotlin-client-petstore-retrofit2-rx.sh b/bin/openapi3/kotlin-client-petstore-retrofit2-rx.sh new file mode 100755 index 00000000000..fef65a303b2 --- /dev/null +++ b/bin/openapi3/kotlin-client-petstore-retrofit2-rx.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +while [ -h "$SCRIPT" ] ; do + ls=$(ls -ld "$SCRIPT") + link=$(expr "$ls" : '.*-> \(.*\)$') + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=$(dirname "$SCRIPT")/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=$(dirname "$SCRIPT")/.. + APP_DIR=$(cd "${APP_DIR}"; pwd) +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +samplePath="samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx" + +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-rx-client --library jvm-retrofit2 --additional-properties serializationLibrary=gson,dateLibrary=java8,serializableModel=true,useRxJava=true -o $samplePath $@" + +echo "Cleaning previously generated files if any from $samplePath" +rm -rf $samplePath + +echo "Generating Kotling client..." +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/kotlin-client-petstore-retrofit2-rx2.sh b/bin/openapi3/kotlin-client-petstore-retrofit2-rx2.sh new file mode 100755 index 00000000000..d6265f8fea9 --- /dev/null +++ b/bin/openapi3/kotlin-client-petstore-retrofit2-rx2.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +while [ -h "$SCRIPT" ] ; do + ls=$(ls -ld "$SCRIPT") + link=$(expr "$ls" : '.*-> \(.*\)$') + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=$(dirname "$SCRIPT")/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=$(dirname "$SCRIPT")/.. + APP_DIR=$(cd "${APP_DIR}"; pwd) +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +samplePath="samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2" + +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-rx2-client --library jvm-retrofit2 --additional-properties serializationLibrary=gson,dateLibrary=java8,serializableModel=true,useRxJava2=true -o $samplePath $@" + +echo "Cleaning previously generated files if any from $samplePath" +rm -rf $samplePath + +echo "Generating Kotling client..." +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/kotlin-client-petstore.sh b/bin/openapi3/kotlin-client-petstore.sh index d0352276800..a36d42599be 100755 --- a/bin/openapi3/kotlin-client-petstore.sh +++ b/bin/openapi3/kotlin-client-petstore.sh @@ -25,11 +25,13 @@ then mvn clean package fi -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-client --additional-properties dateLibrary=java8,serializableModel=true -o samples/openapi3/client/petstore/kotlin $@" +samplePath="samples/openapi3/client/petstore/kotlin" -echo "Cleaning previously generated files if any from samples/openapi3/client/petstore/kotlin" -rm -rf samples/openapi3/client/petstore/kotlin +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-client --additional-properties dateLibrary=java8,serializableModel=true -o $samplePath $@" + +echo "Cleaning previously generated files if any from $samplePath" +rm -rf $samplePath echo "Generating Kotling client..." java $JAVA_OPTS -jar $executable $ags diff --git a/docs/generators/kotlin-server.md b/docs/generators/kotlin-server.md index 239ac58e19f..828b0c99cbe 100644 --- a/docs/generators/kotlin-server.md +++ b/docs/generators/kotlin-server.md @@ -45,9 +45,9 @@ sidebar_label: kotlin-server | Type/Alias | Instantiated By | | ---------- | --------------- | -|array|kotlin.arrayOf| -|list|kotlin.arrayOf| -|map|kotlin.mapOf| +|array|kotlin.Array| +|list|kotlin.collections.ArrayList| +|map|kotlin.collections.HashMap| ## LANGUAGE PRIMITIVES diff --git a/docs/generators/kotlin-spring.md b/docs/generators/kotlin-spring.md index 53b8864cd86..b088f30ba11 100644 --- a/docs/generators/kotlin-spring.md +++ b/docs/generators/kotlin-spring.md @@ -54,9 +54,9 @@ sidebar_label: kotlin-spring | Type/Alias | Instantiated By | | ---------- | --------------- | -|array|kotlin.arrayOf| -|list|kotlin.arrayOf| -|map|kotlin.mapOf| +|array|kotlin.Array| +|list|kotlin.collections.ArrayList| +|map|kotlin.collections.HashMap| ## LANGUAGE PRIMITIVES diff --git a/docs/generators/kotlin-vertx.md b/docs/generators/kotlin-vertx.md index f7aa85af621..5f0136bf5e6 100644 --- a/docs/generators/kotlin-vertx.md +++ b/docs/generators/kotlin-vertx.md @@ -39,9 +39,9 @@ sidebar_label: kotlin-vertx | Type/Alias | Instantiated By | | ---------- | --------------- | -|array|kotlin.arrayOf| -|list|kotlin.arrayOf| -|map|kotlin.mapOf| +|array|kotlin.Array| +|list|kotlin.collections.ArrayList| +|map|kotlin.collections.HashMap| ## LANGUAGE PRIMITIVES diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index f212508f70b..af5c9a3f874 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -22,6 +22,9 @@ sidebar_label: kotlin |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null| |sourceFolder|source folder for generated code| |src/main/kotlin| +|useCoroutines|Whether to use the Coroutines adapter with the retrofit2 library.| |false| +|useRxJava|Whether to use the RxJava adapter with the retrofit2 library.| |false| +|useRxJava2|Whether to use the RxJava2 adapter with the retrofit2 library.| |false| ## IMPORT MAPPING @@ -43,9 +46,9 @@ sidebar_label: kotlin | Type/Alias | Instantiated By | | ---------- | --------------- | -|array|kotlin.arrayOf| -|list|kotlin.arrayOf| -|map|kotlin.mapOf| +|array|kotlin.Array| +|list|kotlin.collections.ArrayList| +|map|kotlin.collections.HashMap| ## LANGUAGE PRIMITIVES 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 bc582f75616..05de11aa5c2 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 @@ -162,9 +162,9 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co typeMapping.put("Date", "java.time.LocalDate"); typeMapping.put("DateTime", "java.time.LocalDateTime"); - instantiationTypes.put("array", "kotlin.arrayOf"); - instantiationTypes.put("list", "kotlin.arrayOf"); - instantiationTypes.put("map", "kotlin.mapOf"); + instantiationTypes.put("array", "kotlin.Array"); + instantiationTypes.put("list", "kotlin.collections.ArrayList"); + instantiationTypes.put("map", "kotlin.collections.HashMap"); importMapping = new HashMap(); importMapping.put("BigDecimal", "java.math.BigDecimal"); 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 4580ad56a90..cd80b05410b 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 @@ -26,17 +26,20 @@ import org.openapitools.codegen.CodegenProperty; import org.openapitools.codegen.CodegenType; import org.openapitools.codegen.SupportingFile; import org.openapitools.codegen.meta.features.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.File; import java.util.HashMap; import java.util.List; -import java.util.Locale; import java.util.Map; import java.util.stream.Collectors; import java.util.stream.Stream; public class KotlinClientCodegen extends AbstractKotlinCodegen { + private static final Logger LOGGER = LoggerFactory.getLogger(KotlinClientCodegen.class); + protected static final String JVM = "jvm"; protected static final String JVM_OKHTTP = "jvm-okhttp"; protected static final String JVM_OKHTTP4 = "jvm-okhttp4"; @@ -44,6 +47,11 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { protected static final String JVM_RETROFIT2 = "jvm-retrofit2"; protected static final String MULTIPLATFORM = "multiplatform"; + public static final String USE_RX_JAVA = "useRxJava"; + public static final String USE_RX_JAVA2 = "useRxJava2"; + public static final String USE_COROUTINES = "useCoroutines"; + public static final String DO_NOT_USE_RX_AND_COROUTINES = "doNotUseRxAndCoroutines"; + public static final String DATE_LIBRARY = "dateLibrary"; public static final String REQUEST_DATE_CONVERTER = "requestDateConverter"; public static final String COLLECTION_TYPE = "collectionType"; @@ -53,6 +61,12 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { protected String dateLibrary = DateLibrary.JAVA8.value; protected String requestDateConverter = RequestDateConverter.TO_JSON.value; protected String collectionType = CollectionType.ARRAY.value; + protected boolean useRxJava = false; + protected boolean useRxJava2 = false; + protected boolean useCoroutines = false; + // 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; public enum DateLibrary { STRING("string"), @@ -177,6 +191,10 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { requestDateConverter.setEnum(requestDateConverterOptions); requestDateConverter.setDefault(this.requestDateConverter); cliOptions.add(requestDateConverter); + + cliOptions.add(CliOption.newBoolean(USE_RX_JAVA, "Whether to use the RxJava adapter with the retrofit2 library.")); + cliOptions.add(CliOption.newBoolean(USE_RX_JAVA2, "Whether to use the RxJava2 adapter with the retrofit2 library.")); + cliOptions.add(CliOption.newBoolean(USE_COROUTINES, "Whether to use the Coroutines adapter with the retrofit2 library.")); } public CodegenType getTag() { @@ -191,6 +209,43 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { return "Generates a Kotlin client."; } + public void setUseRxJava(boolean useRxJava) { + if (useRxJava) { + this.useRxJava2 = false; + this.doNotUseRxAndCoroutines = false; + this.useCoroutines = false; + } + this.useRxJava = useRxJava; + } + + public void setUseRxJava2(boolean useRxJava2) { + if (useRxJava2) { + this.useRxJava = false; + this.doNotUseRxAndCoroutines = false; + this.useCoroutines = false; + } + this.useRxJava2 = useRxJava2; + } + + public void setDoNotUseRxAndCoroutines(boolean doNotUseRxAndCoroutines) { + if (doNotUseRxAndCoroutines) { + this.useRxJava = false; + this.useRxJava2 = false; + this.useCoroutines = false; + } + this.doNotUseRxAndCoroutines = doNotUseRxAndCoroutines; + } + + public void setUseCoroutines(boolean useCoroutines) { + if (useCoroutines) { + this.useRxJava = false; + this.useRxJava2 = false; + this.doNotUseRxAndCoroutines = false; + } + this.useCoroutines = useCoroutines; + } + + public void setDateLibrary(String library) { this.dateLibrary = library; } @@ -211,6 +266,38 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { sourceFolder = "src/commonMain/kotlin"; } + + boolean hasRx = additionalProperties.containsKey(USE_RX_JAVA); + boolean hasRx2 = additionalProperties.containsKey(USE_RX_JAVA2); + boolean hasCoroutines = additionalProperties.containsKey(USE_COROUTINES); + int optionCount = 0; + if (hasRx) { + optionCount++; + } + if (hasRx2) { + optionCount++; + } + if (hasCoroutines) { + optionCount++; + } + boolean hasConflict = optionCount > 1; + + // RxJava & Coroutines + if (hasConflict) { + LOGGER.warn("You specified both RxJava versions 1 and 2 or Coroutines together, please choose one them."); + } else if (hasRx) { + this.setUseRxJava(Boolean.valueOf(additionalProperties.get(USE_RX_JAVA).toString())); + } else if (hasRx2) { + this.setUseRxJava2(Boolean.valueOf(additionalProperties.get(USE_RX_JAVA2).toString())); + } else if (hasCoroutines) { + this.setUseCoroutines(Boolean.valueOf(additionalProperties.get(USE_COROUTINES).toString())); + } + + if (!hasRx && !hasRx2 && !hasCoroutines) { + setDoNotUseRxAndCoroutines(true); + additionalProperties.put(DO_NOT_USE_RX_AND_COROUTINES, true); + } + // infrastructure destination folder final String infrastructureFolder = (sourceFolder + File.separator + packageName + File.separator + "infrastructure").replace(".", "/"); diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/build.gradle.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/build.gradle.mustache index 82a624d4700..b5481b71630 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/build.gradle.mustache @@ -11,6 +11,12 @@ buildscript { {{#jvm-retrofit2}} ext.retrofitVersion = '2.6.2' {{/jvm-retrofit2}} + {{#useRxJava}} + ext.rxJavaVersion = '1.3.8' + {{/useRxJava}} + {{#useRxJava2}} + ext.rxJava2Version = '2.2.17' + {{/useRxJava2}} repositories { maven { url "https://repo1.maven.org/maven2" } @@ -80,6 +86,14 @@ dependencies { compile "org.threeten:threetenbp:1.4.0" {{/threetenbp}} {{#jvm-retrofit2}} + {{#useRxJava}} + compile "io.reactivex:rxjava:$rxJavaVersion" + compile "com.squareup.retrofit2:adapter-rxjava:$retrofitVersion" + {{/useRxJava}} + {{#useRxJava2}} + compile "io.reactivex.rxjava2:rxjava:$rxJava2Version" + compile "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion" + {{/useRxJava2}} compile "com.squareup.retrofit2:retrofit:$retrofitVersion" {{#gson}} compile "com.squareup.retrofit2:converter-gson:$retrofitVersion" 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 2ae8de79774..ec0fdf07b2d 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 @@ -45,7 +45,7 @@ import java.io.Serializable {{#allVars}} {{#required}}{{>data_class_req_var}}{{/required}}{{^required}}{{>data_class_opt_var}}{{/required}}{{^-last}},{{/-last}} {{/allVars}} -){{/discriminator}}{{#parent}}{{^serializableModel}}{{^parcelizeModels}} : {{parent}}{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{#serializableModel}}{{^parcelizeModels}} : {{parent}}, Serializable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{^serializableModel}}{{#parcelizeModels}} : {{parent}}, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{#serializableModel}}{{#parcelizeModels}} : {{parent}}, Serializable, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{#serializableModel}}{{^parcelizeModels}} : Serializable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{^serializableModel}}{{#parcelizeModels}} : Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{#serializableModel}}{{#parcelizeModels}} : Serializable, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#vendorExtensions.x-has-data-class-body}} { +){{/discriminator}}{{#parent}}{{^serializableModel}}{{^parcelizeModels}} : {{{parent}}}{{#isMapModel}}(){{/isMapModel}}{{#isArrayModel}}(){{/isArrayModel}}{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{#serializableModel}}{{^parcelizeModels}} : {{{parent}}}{{#isMapModel}}(){{/isMapModel}}{{#isArrayModel}}(){{/isArrayModel}}, Serializable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{^serializableModel}}{{#parcelizeModels}} : {{{parent}}}{{#isMapModel}}(){{/isMapModel}}{{#isArrayModel}}(){{/isArrayModel}}, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{#serializableModel}}{{#parcelizeModels}} : {{{parent}}}{{#isMapModel}}(){{/isMapModel}}{{#isArrayModel}}(){{/isArrayModel}}, Serializable, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{#serializableModel}}{{^parcelizeModels}} : Serializable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{^serializableModel}}{{#parcelizeModels}} : Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{#serializableModel}}{{#parcelizeModels}} : Serializable, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#vendorExtensions.x-has-data-class-body}} { {{/vendorExtensions.x-has-data-class-body}} {{#serializableModel}} {{#nonPublicApi}}internal {{/nonPublicApi}}companion object { @@ -71,10 +71,10 @@ import java.io.Serializable @Json(name = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} {{/moshi}} {{#gson}} - @SerializedName(value={{{value}}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} + @SerializedName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} {{/gson}} {{#jackson}} - @JsonProperty(value={{{value}}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} + @JsonProperty(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} {{/jackson}} {{/multiplatform}} {{#multiplatform}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/interface_opt_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/interface_opt_var.mustache index e87ea002974..3284d7b1db4 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/interface_opt_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/interface_opt_var.mustache @@ -6,7 +6,7 @@ @Json(name = "{{{vendorExtensions.x-base-name-literal}}}") {{/moshi}} {{#gson}} - @SerializedName("{{{vendorExtensions.x-base-name-literal}}}") + @get:SerializedName("{{{vendorExtensions.x-base-name-literal}}}") {{/gson}} {{#jackson}} @get:JsonProperty("{{{vendorExtensions.x-base-name-literal}}}") diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/interface_req_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/interface_req_var.mustache index 49bbc4ee5c7..ee62fbb2d12 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/interface_req_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/interface_req_var.mustache @@ -6,7 +6,7 @@ @Json(name = "{{{vendorExtensions.x-base-name-literal}}}") {{/moshi}} {{#gson}} - @SerializedName("{{{vendorExtensions.x-base-name-literal}}}") + @get:SerializedName("{{{vendorExtensions.x-base-name-literal}}}") {{/gson}} {{#jackson}} @get:JsonProperty("{{{vendorExtensions.x-base-name-literal}}}") diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/api.mustache index 66938213465..4f1a70a501a 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/api.mustache @@ -2,10 +2,25 @@ package {{apiPackage}} import {{packageName}}.infrastructure.CollectionFormats.* import retrofit2.http.* +{{#doNotUseRxAndCoroutines}} import retrofit2.Call +{{/doNotUseRxAndCoroutines}} import okhttp3.RequestBody import okhttp3.ResponseBody import okhttp3.MultipartBody +{{^doNotUseRxAndCoroutines}} +{{#useRxJava}} +import rx.Observable +{{/useRxJava}} +{{#useRxJava2}} +import io.reactivex.Single +{{/useRxJava2}} +{{^returnType}} +{{#useRxJava2}} +import io.reactivex.Completable +{{/useRxJava2}} +{{/returnType}} +{{/doNotUseRxAndCoroutines}} {{#imports}}import {{import}} {{/imports}} @@ -31,7 +46,7 @@ interface {{classname}} { {{/prioritizedContentTypes}} {{/formParams}} @{{httpMethod}}("{{{path}}}") - fun {{operationId}}({{^allParams}}){{/allParams}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}}, {{/hasMore}}{{^hasMore}}){{/hasMore}}{{/allParams}}: Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}}{{/isResponseFile}}> + {{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}({{^allParams}}){{/allParams}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}}, {{/hasMore}}{{^hasMore}}){{/hasMore}}{{/allParams}}: {{^doNotUseRxAndCoroutines}}{{#useRxJava}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}}{{/isResponseFile}}>{{/useRxJava}}{{#useRxJava2}}{{#returnType}}Single<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useCoroutines}}{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}}{{/isResponseFile}}{{/useCoroutines}}{{/doNotUseRxAndCoroutines}}{{#doNotUseRxAndCoroutines}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}}{{/isResponseFile}}>{{/doNotUseRxAndCoroutines}} {{/operation}} } diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/formParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/formParams.mustache index 2fc767cb2cf..d5267aa7746 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/formParams.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isFile}}{{#isMultipart}}@Part{{/isMultipart}}{{^isMultipart}}@Field{{/isMultipart}}("{{baseName}}") {{{paramName}}}: {{{dataType}}}{{/isFile}}{{#isFile}}{{#isMultipart}}@Part{{/isMultipart}}{{^isMultipart}}@Field("{{baseName}}"){{/isMultipart}} {{{paramName}}}: MultipartBody.Part {{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isFile}}{{#isMultipart}}@Part{{/isMultipart}}{{^isMultipart}}@Field{{/isMultipart}}("{{baseName}}") {{{paramName}}}: {{{dataType}}}{{/isFile}}{{#isFile}}{{#isMultipart}}@Part{{/isMultipart}}{{^isMultipart}}@Field("{{baseName}}"){{/isMultipart}} {{{paramName}}}: MultipartBody.Part{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache index 723be88b00a..71c558c8519 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache @@ -3,6 +3,12 @@ package {{packageName}}.infrastructure import okhttp3.OkHttpClient import retrofit2.Retrofit import retrofit2.converter.scalars.ScalarsConverterFactory +{{#useRxJava}} +import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory +{{/useRxJava}} +{{#useRxJava2}} +import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory +{{/useRxJava2}} {{#gson}} import retrofit2.converter.gson.GsonConverterFactory {{/gson}} @@ -33,6 +39,12 @@ import retrofit2.converter.moshi.MoshiConverterFactory {{#gson}} .addConverterFactory(GsonConverterFactory.create(Serializer.gson)) {{/gson}} + {{#useRxJava}} + .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) + {{/useRxJava}} + {{#useRxJava2}} + .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) + {{/useRxJava2}} {{#moshi}} .addConverterFactory(MoshiConverterFactory.create(Serializer.moshi)) {{/moshi}} diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Order.kt index ae3a28a775e..4f9f9fde453 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -45,9 +45,9 @@ data class Order ( */ enum class Status(val value: kotlin.String){ - @SerializedName(value="placed") placed("placed"), - @SerializedName(value="approved") approved("approved"), - @SerializedName(value="delivered") delivered("delivered"); + @SerializedName(value = "placed") placed("placed"), + @SerializedName(value = "approved") approved("approved"), + @SerializedName(value = "delivered") delivered("delivered"); } } diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt index 4a5187302bd..54d9edce52d 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -47,9 +47,9 @@ data class Pet ( */ enum class Status(val value: kotlin.String){ - @SerializedName(value="available") available("available"), - @SerializedName(value="pending") pending("pending"), - @SerializedName(value="sold") sold("sold"); + @SerializedName(value = "available") available("available"), + @SerializedName(value = "pending") pending("pending"), + @SerializedName(value = "sold") sold("sold"); } } diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt index b4963540cad..396961979b0 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -45,9 +45,9 @@ data class Order ( */ enum class Status(val value: kotlin.String){ - @JsonProperty(value="placed") PLACED("placed"), - @JsonProperty(value="approved") APPROVED("approved"), - @JsonProperty(value="delivered") DELIVERED("delivered"); + @JsonProperty(value = "placed") PLACED("placed"), + @JsonProperty(value = "approved") APPROVED("approved"), + @JsonProperty(value = "delivered") DELIVERED("delivered"); } } diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt index 2978f66f176..26e9a9dce2e 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -47,9 +47,9 @@ data class Pet ( */ enum class Status(val value: kotlin.String){ - @JsonProperty(value="available") AVAILABLE("available"), - @JsonProperty(value="pending") PENDING("pending"), - @JsonProperty(value="sold") SOLD("sold"); + @JsonProperty(value = "available") AVAILABLE("available"), + @JsonProperty(value = "pending") PENDING("pending"), + @JsonProperty(value = "sold") SOLD("sold"); } } 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 75f3323445c..e0257edb0f4 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 @@ -36,6 +36,6 @@ interface PetApi { @Multipart @POST("/pet/{petId}/uploadImage") - fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String, @Part file: MultipartBody.Part ): Call + fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String, @Part file: MultipartBody.Part): Call } diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/.openapi-generator-ignore b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/.openapi-generator/VERSION b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/.openapi-generator/VERSION new file mode 100644 index 00000000000..b5d898602c2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/README.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/README.md new file mode 100644 index 00000000000..b7028d917a2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/README.md @@ -0,0 +1,173 @@ +# org.openapitools.client - Kotlin client library for OpenAPI Petstore + +## Requires + +* Kotlin 1.3.41 +* Gradle 4.9 + +## Build + +First, create the gradle wrapper script: + +``` +gradle wrapper +``` + +Then, run: + +``` +./gradlew check assemble +``` + +This runs all tests and packages the library. + +## Features/Implementation Notes + +* Supports JSON inputs/outputs, File inputs, and Form inputs. +* Supports collection formats for query parameters: csv, tsv, ssv, pipes. +* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions. +* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets. + + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io: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* | [**fakeHttpSignatureTest**](docs/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication +*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 +*FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters | +*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 + + - [org.openapitools.client.models.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [org.openapitools.client.models.Animal](docs/Animal.md) + - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) + - [org.openapitools.client.models.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [org.openapitools.client.models.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [org.openapitools.client.models.ArrayTest](docs/ArrayTest.md) + - [org.openapitools.client.models.Capitalization](docs/Capitalization.md) + - [org.openapitools.client.models.Cat](docs/Cat.md) + - [org.openapitools.client.models.CatAllOf](docs/CatAllOf.md) + - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ClassModel](docs/ClassModel.md) + - [org.openapitools.client.models.Client](docs/Client.md) + - [org.openapitools.client.models.Dog](docs/Dog.md) + - [org.openapitools.client.models.DogAllOf](docs/DogAllOf.md) + - [org.openapitools.client.models.EnumArrays](docs/EnumArrays.md) + - [org.openapitools.client.models.EnumClass](docs/EnumClass.md) + - [org.openapitools.client.models.EnumTest](docs/EnumTest.md) + - [org.openapitools.client.models.FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [org.openapitools.client.models.Foo](docs/Foo.md) + - [org.openapitools.client.models.FormatTest](docs/FormatTest.md) + - [org.openapitools.client.models.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [org.openapitools.client.models.HealthCheckResult](docs/HealthCheckResult.md) + - [org.openapitools.client.models.InlineObject](docs/InlineObject.md) + - [org.openapitools.client.models.InlineObject1](docs/InlineObject1.md) + - [org.openapitools.client.models.InlineObject2](docs/InlineObject2.md) + - [org.openapitools.client.models.InlineObject3](docs/InlineObject3.md) + - [org.openapitools.client.models.InlineObject4](docs/InlineObject4.md) + - [org.openapitools.client.models.InlineObject5](docs/InlineObject5.md) + - [org.openapitools.client.models.InlineResponseDefault](docs/InlineResponseDefault.md) + - [org.openapitools.client.models.List](docs/List.md) + - [org.openapitools.client.models.MapTest](docs/MapTest.md) + - [org.openapitools.client.models.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [org.openapitools.client.models.Model200Response](docs/Model200Response.md) + - [org.openapitools.client.models.Name](docs/Name.md) + - [org.openapitools.client.models.NullableClass](docs/NullableClass.md) + - [org.openapitools.client.models.NumberOnly](docs/NumberOnly.md) + - [org.openapitools.client.models.Order](docs/Order.md) + - [org.openapitools.client.models.OuterComposite](docs/OuterComposite.md) + - [org.openapitools.client.models.OuterEnum](docs/OuterEnum.md) + - [org.openapitools.client.models.OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [org.openapitools.client.models.OuterEnumInteger](docs/OuterEnumInteger.md) + - [org.openapitools.client.models.OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) + - [org.openapitools.client.models.Pet](docs/Pet.md) + - [org.openapitools.client.models.ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [org.openapitools.client.models.Return](docs/Return.md) + - [org.openapitools.client.models.SpecialModelname](docs/SpecialModelname.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 + + +### 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 + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/build.gradle b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/build.gradle new file mode 100644 index 00000000000..9f83d5b1d79 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/build.gradle @@ -0,0 +1,38 @@ +group 'org.openapitools' +version '1.0.0' + +wrapper { + gradleVersion = '4.9' + distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" +} + +buildscript { + ext.kotlin_version = '1.3.61' + ext.retrofitVersion = '2.6.2' + + repositories { + maven { url "https://repo1.maven.org/maven2" } + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +apply plugin: 'kotlin' + +repositories { + maven { url "https://repo1.maven.org/maven2" } +} + +test { + useJUnitPlatform() +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + compile "com.google.code.gson:gson:2.8.6" + compile "com.squareup.retrofit2:retrofit:$retrofitVersion" + compile "com.squareup.retrofit2:converter-gson:$retrofitVersion" + compile "com.squareup.retrofit2:converter-scalars:$retrofitVersion" + testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0" +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/200Response.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/200Response.md new file mode 100644 index 00000000000..53c1edacfb8 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/200Response.md @@ -0,0 +1,11 @@ + +# Model200Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.Int** | | [optional] +**propertyClass** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..1025301ce94 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/AdditionalPropertiesClass.md @@ -0,0 +1,11 @@ + +# AdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapProperty** | **kotlin.collections.Map<kotlin.String, kotlin.String>** | | [optional] +**mapOfMapProperty** | **kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Animal.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Animal.md new file mode 100644 index 00000000000..5ce5a4972c8 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Animal.md @@ -0,0 +1,11 @@ + +# Animal + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **kotlin.String** | | +**color** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..55d482238db --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/AnotherFakeApi.md @@ -0,0 +1,56 @@ +# 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 +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = AnotherFakeApi() +val client : Client = // Client | client model +try { + val result : Client = apiInstance.call123testSpecialTags(client) + println(result) +} catch (e: ClientException) { + println("4xx response calling AnotherFakeApi#call123testSpecialTags") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling AnotherFakeApi#call123testSpecialTags") + 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 + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ApiResponse.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ApiResponse.md new file mode 100644 index 00000000000..6b4c6bf2779 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ApiResponse.md @@ -0,0 +1,12 @@ + +# ApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **kotlin.Int** | | [optional] +**type** | **kotlin.String** | | [optional] +**message** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 00000000000..23a47566420 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,10 @@ + +# ArrayOfArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayArrayNumber** | **kotlin.Array<kotlin.Array<java.math.BigDecimal>>** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ArrayOfNumberOnly.md new file mode 100644 index 00000000000..b115a5d54c2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ArrayOfNumberOnly.md @@ -0,0 +1,10 @@ + +# ArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayNumber** | [**kotlin.Array<java.math.BigDecimal>**](java.math.BigDecimal.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ArrayTest.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ArrayTest.md new file mode 100644 index 00000000000..aa0bbbe936c --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ArrayTest.md @@ -0,0 +1,12 @@ + +# ArrayTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayOfString** | **kotlin.Array<kotlin.String>** | | [optional] +**arrayArrayOfInteger** | **kotlin.Array<kotlin.Array<kotlin.Long>>** | | [optional] +**arrayArrayOfModel** | **kotlin.Array<kotlin.Array<ReadOnlyFirst>>** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Capitalization.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Capitalization.md new file mode 100644 index 00000000000..9d44a82fb7f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Capitalization.md @@ -0,0 +1,15 @@ + +# Capitalization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**smallCamel** | **kotlin.String** | | [optional] +**capitalCamel** | **kotlin.String** | | [optional] +**smallSnake** | **kotlin.String** | | [optional] +**capitalSnake** | **kotlin.String** | | [optional] +**scAETHFlowPoints** | **kotlin.String** | | [optional] +**ATT_NAME** | **kotlin.String** | Name of the pet | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Cat.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Cat.md new file mode 100644 index 00000000000..b6da7c47ced --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Cat.md @@ -0,0 +1,10 @@ + +# Cat + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **kotlin.Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/CatAllOf.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/CatAllOf.md new file mode 100644 index 00000000000..fb8883197a1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/CatAllOf.md @@ -0,0 +1,10 @@ + +# CatAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **kotlin.Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Category.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Category.md new file mode 100644 index 00000000000..1f12c3eb158 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Category.md @@ -0,0 +1,11 @@ + +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | | +**id** | **kotlin.Long** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ClassModel.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ClassModel.md new file mode 100644 index 00000000000..50ad61b51a5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ClassModel.md @@ -0,0 +1,10 @@ + +# ClassModel + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**propertyClass** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Client.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Client.md new file mode 100644 index 00000000000..11afbcf0c9f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Client.md @@ -0,0 +1,10 @@ + +# Client + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/DefaultApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/DefaultApi.md new file mode 100644 index 00000000000..784be537594 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/DefaultApi.md @@ -0,0 +1,50 @@ +# 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 +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = DefaultApi() +try { + val result : InlineResponseDefault = apiInstance.fooGet() + println(result) +} catch (e: ClientException) { + println("4xx response calling DefaultApi#fooGet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling DefaultApi#fooGet") + 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 + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Dog.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Dog.md new file mode 100644 index 00000000000..41d9c6ba0d1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Dog.md @@ -0,0 +1,10 @@ + +# Dog + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/DogAllOf.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/DogAllOf.md new file mode 100644 index 00000000000..6b14d5e9147 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/DogAllOf.md @@ -0,0 +1,10 @@ + +# DogAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/EnumArrays.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/EnumArrays.md new file mode 100644 index 00000000000..719084e5f94 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/EnumArrays.md @@ -0,0 +1,25 @@ + +# EnumArrays + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justSymbol** | [**inline**](#JustSymbolEnum) | | [optional] +**arrayEnum** | [**inline**](#kotlin.Array<ArrayEnumEnum>) | | [optional] + + + +## Enum: just_symbol +Name | Value +---- | ----- +justSymbol | >=, $ + + + +## Enum: array_enum +Name | Value +---- | ----- +arrayEnum | fish, crab + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/EnumClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/EnumClass.md new file mode 100644 index 00000000000..5ddb262871f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/EnumClass.md @@ -0,0 +1,14 @@ + +# EnumClass + +## Enum + + + * `abc` (value: `"_abc"`) + + * `minusEfg` (value: `"-efg"`) + + * `leftParenthesisXyzRightParenthesis` (value: `"(xyz)"`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/EnumTest.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/EnumTest.md new file mode 100644 index 00000000000..f0370049eb3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/EnumTest.md @@ -0,0 +1,45 @@ + +# EnumTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumStringRequired** | [**inline**](#EnumStringRequiredEnum) | | +**enumString** | [**inline**](#EnumStringEnum) | | [optional] +**enumInteger** | [**inline**](#EnumIntegerEnum) | | [optional] +**enumNumber** | [**inline**](#EnumNumberEnum) | | [optional] +**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] +**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] + + + +## Enum: enum_string_required +Name | Value +---- | ----- +enumStringRequired | UPPER, lower, + + + +## Enum: enum_string +Name | Value +---- | ----- +enumString | UPPER, lower, + + + +## Enum: enum_integer +Name | Value +---- | ----- +enumInteger | 1, -1 + + + +## Enum: enum_number +Name | Value +---- | ----- +enumNumber | 1.1, -1.2 + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FakeApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FakeApi.md new file mode 100644 index 00000000000..fb663183f92 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FakeApi.md @@ -0,0 +1,776 @@ +# 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 +[**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 | +[**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-paramters | + + + +# **fakeHealthGet** +> HealthCheckResult fakeHealthGet() + +Health check endpoint + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +try { + val result : HealthCheckResult = apiInstance.fakeHealthGet() + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeHealthGet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeHealthGet") + 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 + + +# **fakeHttpSignatureTest** +> fakeHttpSignatureTest(pet, query1, header1) + +test http signature authentication + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +val query1 : kotlin.String = query1_example // kotlin.String | query parameter +val header1 : kotlin.String = header1_example // kotlin.String | header parameter +try { + apiInstance.fakeHttpSignatureTest(pet, query1, header1) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeHttpSignatureTest") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeHttpSignatureTest") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **query1** | **kotlin.String**| query parameter | [optional] + **header1** | **kotlin.String**| header parameter | [optional] + +### Return type + +null (empty response body) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +# **fakeOuterBooleanSerialize** +> kotlin.Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val body : kotlin.Boolean = true // kotlin.Boolean | Input boolean as post body +try { + val result : kotlin.Boolean = apiInstance.fakeOuterBooleanSerialize(body) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterBooleanSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterBooleanSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **kotlin.Boolean**| Input boolean as post body | [optional] + +### Return type + +**kotlin.Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(outerComposite) + + + +Test serialization of object with outer number type + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val outerComposite : OuterComposite = // OuterComposite | Input composite as post body +try { + val result : OuterComposite = apiInstance.fakeOuterCompositeSerialize(outerComposite) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterCompositeSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterCompositeSerialize") + 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**: */* + + +# **fakeOuterNumberSerialize** +> java.math.BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val body : java.math.BigDecimal = 8.14 // java.math.BigDecimal | Input number as post body +try { + val result : java.math.BigDecimal = apiInstance.fakeOuterNumberSerialize(body) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterNumberSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterNumberSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **java.math.BigDecimal**| Input number as post body | [optional] + +### Return type + +[**java.math.BigDecimal**](java.math.BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +# **fakeOuterStringSerialize** +> kotlin.String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val body : kotlin.String = body_example // kotlin.String | Input string as post body +try { + val result : kotlin.String = apiInstance.fakeOuterStringSerialize(body) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterStringSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterStringSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **kotlin.String**| Input string as post body | [optional] + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +# **testBodyWithFileSchema** +> testBodyWithFileSchema(fileSchemaTestClass) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val fileSchemaTestClass : FileSchemaTestClass = // FileSchemaTestClass | +try { + apiInstance.testBodyWithFileSchema(fileSchemaTestClass) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testBodyWithFileSchema") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testBodyWithFileSchema") + 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 + + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val query : kotlin.String = query_example // kotlin.String | +val user : User = // User | +try { + apiInstance.testBodyWithQueryParams(query, user) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testBodyWithQueryParams") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testBodyWithQueryParams") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **kotlin.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 + + +# **testClientModel** +> Client testClientModel(client) + +To test \"client\" model + +To test \"client\" model + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val client : Client = // Client | client model +try { + val result : Client = apiInstance.testClientModel(client) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testClientModel") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testClientModel") + 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 + + +# **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 +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val number : java.math.BigDecimal = 8.14 // java.math.BigDecimal | None +val double : kotlin.Double = 1.2 // kotlin.Double | None +val patternWithoutDelimiter : kotlin.String = patternWithoutDelimiter_example // kotlin.String | None +val byte : kotlin.ByteArray = BYTE_ARRAY_DATA_HERE // kotlin.ByteArray | None +val integer : kotlin.Int = 56 // kotlin.Int | None +val int32 : kotlin.Int = 56 // kotlin.Int | None +val int64 : kotlin.Long = 789 // kotlin.Long | None +val float : kotlin.Float = 3.4 // kotlin.Float | None +val string : kotlin.String = string_example // kotlin.String | None +val binary : java.io.File = BINARY_DATA_HERE // java.io.File | None +val date : java.time.LocalDate = 2013-10-20 // java.time.LocalDate | None +val dateTime : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | None +val password : kotlin.String = password_example // kotlin.String | None +val paramCallback : kotlin.String = paramCallback_example // kotlin.String | None +try { + apiInstance.testEndpointParameters(number, double, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, paramCallback) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testEndpointParameters") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testEndpointParameters") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **java.math.BigDecimal**| None | + **double** | **kotlin.Double**| None | + **patternWithoutDelimiter** | **kotlin.String**| None | + **byte** | **kotlin.ByteArray**| None | + **integer** | **kotlin.Int**| None | [optional] + **int32** | **kotlin.Int**| None | [optional] + **int64** | **kotlin.Long**| None | [optional] + **float** | **kotlin.Float**| None | [optional] + **string** | **kotlin.String**| None | [optional] + **binary** | **java.io.File**| None | [optional] + **date** | **java.time.LocalDate**| None | [optional] + **dateTime** | **java.time.OffsetDateTime**| None | [optional] + **password** | **kotlin.String**| None | [optional] + **paramCallback** | **kotlin.String**| None | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure http_basic_test: + ApiClient.username = "" + ApiClient.password = "" + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **testEnumParameters** +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val enumHeaderStringArray : kotlin.Array = // kotlin.Array | Header parameter enum test (string array) +val enumHeaderString : kotlin.String = enumHeaderString_example // kotlin.String | Header parameter enum test (string) +val enumQueryStringArray : kotlin.Array = // kotlin.Array | Query parameter enum test (string array) +val enumQueryString : kotlin.String = enumQueryString_example // kotlin.String | Query parameter enum test (string) +val enumQueryInteger : kotlin.Int = 56 // kotlin.Int | Query parameter enum test (double) +val enumQueryDouble : kotlin.Double = 1.2 // kotlin.Double | Query parameter enum test (double) +val enumFormStringArray : kotlin.Array = enumFormStringArray_example // kotlin.Array | Form parameter enum test (string array) +val enumFormString : kotlin.String = enumFormString_example // kotlin.String | Form parameter enum test (string) +try { + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testEnumParameters") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testEnumParameters") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumHeaderStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] + **enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to '-efg'] [enum: _abc, -efg, (xyz)] + **enumQueryStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] + **enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to '-efg'] [enum: _abc, -efg, (xyz)] + **enumQueryInteger** | **kotlin.Int**| Query parameter enum test (double) | [optional] [enum: 1, -2] + **enumQueryDouble** | **kotlin.Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to '$'] [enum: >, $] + **enumFormString** | **kotlin.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 + + +# **testGroupParameters** +> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val requiredStringGroup : kotlin.Int = 56 // kotlin.Int | Required String in group parameters +val requiredBooleanGroup : kotlin.Boolean = true // kotlin.Boolean | Required Boolean in group parameters +val requiredInt64Group : kotlin.Long = 789 // kotlin.Long | Required Integer in group parameters +val stringGroup : kotlin.Int = 56 // kotlin.Int | String in group parameters +val booleanGroup : kotlin.Boolean = true // kotlin.Boolean | Boolean in group parameters +val int64Group : kotlin.Long = 789 // kotlin.Long | Integer in group parameters +try { + apiInstance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testGroupParameters") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testGroupParameters") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requiredStringGroup** | **kotlin.Int**| Required String in group parameters | + **requiredBooleanGroup** | **kotlin.Boolean**| Required Boolean in group parameters | + **requiredInt64Group** | **kotlin.Long**| Required Integer in group parameters | + **stringGroup** | **kotlin.Int**| String in group parameters | [optional] + **booleanGroup** | **kotlin.Boolean**| Boolean in group parameters | [optional] + **int64Group** | **kotlin.Long**| Integer in group parameters | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure bearer_test: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **testInlineAdditionalProperties** +> testInlineAdditionalProperties(requestBody) + +test inline additionalProperties + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val requestBody : kotlin.collections.Map = // kotlin.collections.Map | request body +try { + apiInstance.testInlineAdditionalProperties(requestBody) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testInlineAdditionalProperties") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testInlineAdditionalProperties") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**kotlin.collections.Map<kotlin.String, kotlin.String>**](kotlin.String.md)| request body | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **testJsonFormData** +> testJsonFormData(param, param2) + +test json serialization of form data + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val param : kotlin.String = param_example // kotlin.String | field1 +val param2 : kotlin.String = param2_example // kotlin.String | field2 +try { + apiInstance.testJsonFormData(param, param2) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testJsonFormData") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testJsonFormData") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **kotlin.String**| field1 | + **param2** | **kotlin.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 + + +# **testQueryParameterCollectionFormat** +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val pipe : kotlin.Array = // kotlin.Array | +val ioutil : kotlin.Array = // kotlin.Array | +val http : kotlin.Array = // kotlin.Array | +val url : kotlin.Array = // kotlin.Array | +val context : kotlin.Array = // kotlin.Array | +try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testQueryParameterCollectionFormat") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testQueryParameterCollectionFormat") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **ioutil** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **http** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **url** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **context** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..962dfd4d2dc --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/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** +> Client testClassname(client) + +To test class name in snake case + +To test class name in snake case + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeClassnameTags123Api() +val client : Client = // Client | client model +try { + val result : Client = apiInstance.testClassname(client) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeClassnameTags123Api#testClassname") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeClassnameTags123Api#testClassname") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + + +Configure api_key_query: + ApiClient.apiKey["api_key_query"] = "" + ApiClient.apiKeyPrefix["api_key_query"] = "" + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FileSchemaTestClass.md new file mode 100644 index 00000000000..089e61862c2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FileSchemaTestClass.md @@ -0,0 +1,11 @@ + +# FileSchemaTestClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**java.io.File**](java.io.File.md) | | [optional] +**files** | [**kotlin.Array<java.io.File>**](java.io.File.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Foo.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Foo.md new file mode 100644 index 00000000000..e3e9918872b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Foo.md @@ -0,0 +1,10 @@ + +# Foo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FormatTest.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FormatTest.md new file mode 100644 index 00000000000..0357923c97a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FormatTest.md @@ -0,0 +1,24 @@ + +# FormatTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | +**byte** | **kotlin.ByteArray** | | +**date** | [**java.time.LocalDate**](java.time.LocalDate.md) | | +**password** | **kotlin.String** | | +**integer** | **kotlin.Int** | | [optional] +**int32** | **kotlin.Int** | | [optional] +**int64** | **kotlin.Long** | | [optional] +**float** | **kotlin.Float** | | [optional] +**double** | **kotlin.Double** | | [optional] +**string** | **kotlin.String** | | [optional] +**binary** | [**java.io.File**](java.io.File.md) | | [optional] +**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**uuid** | [**java.util.UUID**](java.util.UUID.md) | | [optional] +**patternWithDigits** | **kotlin.String** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**patternWithDigitsAndDelimiter** | **kotlin.String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/HasOnlyReadOnly.md new file mode 100644 index 00000000000..ed3e4750f44 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/HasOnlyReadOnly.md @@ -0,0 +1,11 @@ + +# HasOnlyReadOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **kotlin.String** | | [optional] [readonly] +**foo** | **kotlin.String** | | [optional] [readonly] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/HealthCheckResult.md new file mode 100644 index 00000000000..472dc310457 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/HealthCheckResult.md @@ -0,0 +1,10 @@ + +# HealthCheckResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nullableMessage** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject.md new file mode 100644 index 00000000000..2156c70addf --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject.md @@ -0,0 +1,11 @@ + +# InlineObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | Updated name of the pet | [optional] +**status** | **kotlin.String** | Updated status of the pet | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject1.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject1.md new file mode 100644 index 00000000000..2a77eecba2b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject1.md @@ -0,0 +1,11 @@ + +# InlineObject1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional] +**file** | [**java.io.File**](java.io.File.md) | file to upload | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject2.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject2.md new file mode 100644 index 00000000000..0720925918b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject2.md @@ -0,0 +1,25 @@ + +# InlineObject2 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumFormStringArray** | [**inline**](#kotlin.Array<EnumFormStringArrayEnum>) | Form parameter enum test (string array) | [optional] +**enumFormString** | [**inline**](#EnumFormStringEnum) | Form parameter enum test (string) | [optional] + + + +## Enum: enum_form_string_array +Name | Value +---- | ----- +enumFormStringArray | >, $ + + + +## Enum: enum_form_string +Name | Value +---- | ----- +enumFormString | _abc, -efg, (xyz) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject3.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject3.md new file mode 100644 index 00000000000..4ca6979b280 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject3.md @@ -0,0 +1,23 @@ + +# InlineObject3 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | None | +**double** | **kotlin.Double** | None | +**patternWithoutDelimiter** | **kotlin.String** | None | +**byte** | **kotlin.ByteArray** | None | +**integer** | **kotlin.Int** | None | [optional] +**int32** | **kotlin.Int** | None | [optional] +**int64** | **kotlin.Long** | None | [optional] +**float** | **kotlin.Float** | None | [optional] +**string** | **kotlin.String** | None | [optional] +**binary** | [**java.io.File**](java.io.File.md) | None | [optional] +**date** | [**java.time.LocalDate**](java.time.LocalDate.md) | None | [optional] +**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | None | [optional] +**password** | **kotlin.String** | None | [optional] +**callback** | **kotlin.String** | None | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject4.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject4.md new file mode 100644 index 00000000000..03c4daa7631 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject4.md @@ -0,0 +1,11 @@ + +# InlineObject4 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**param** | **kotlin.String** | field1 | +**param2** | **kotlin.String** | field2 | + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject5.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject5.md new file mode 100644 index 00000000000..c3c020b20f6 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject5.md @@ -0,0 +1,11 @@ + +# InlineObject5 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**requiredFile** | [**java.io.File**](java.io.File.md) | file to upload | +**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineResponseDefault.md new file mode 100644 index 00000000000..afdd81b1383 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineResponseDefault.md @@ -0,0 +1,10 @@ + +# InlineResponseDefault + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string** | [**Foo**](Foo.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/List.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/List.md new file mode 100644 index 00000000000..13a09a4c414 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/List.md @@ -0,0 +1,10 @@ + +# List + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**`123minusList`** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/MapTest.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/MapTest.md new file mode 100644 index 00000000000..8cee39e3604 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/MapTest.md @@ -0,0 +1,20 @@ + +# MapTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapMapOfString** | **kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>** | | [optional] +**mapOfEnumString** | [**inline**](#kotlin.collections.Map<kotlin.String, InnerEnum>) | | [optional] +**directMap** | **kotlin.collections.Map<kotlin.String, kotlin.Boolean>** | | [optional] +**indirectMap** | **kotlin.collections.Map<kotlin.String, kotlin.Boolean>** | | [optional] + + + +## Enum: map_of_enum_string +Name | Value +---- | ----- +mapOfEnumString | UPPER, lower + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..74456741217 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,12 @@ + +# MixedPropertiesAndAdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | [**java.util.UUID**](java.util.UUID.md) | | [optional] +**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**map** | [**kotlin.collections.Map<kotlin.String, Animal>**](Animal.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Name.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Name.md new file mode 100644 index 00000000000..343700533c7 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Name.md @@ -0,0 +1,13 @@ + +# Name + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.Int** | | +**snakeCase** | **kotlin.Int** | | [optional] [readonly] +**property** | **kotlin.String** | | [optional] +**`123number`** | **kotlin.Int** | | [optional] [readonly] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/NullableClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/NullableClass.md new file mode 100644 index 00000000000..9ec43d0b87c --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/NullableClass.md @@ -0,0 +1,21 @@ + +# NullableClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integerProp** | **kotlin.Int** | | [optional] +**numberProp** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] +**booleanProp** | **kotlin.Boolean** | | [optional] +**stringProp** | **kotlin.String** | | [optional] +**dateProp** | [**java.time.LocalDate**](java.time.LocalDate.md) | | [optional] +**datetimeProp** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**arrayNullableProp** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**arrayAndItemsNullableProp** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**arrayItemsNullable** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectNullableProp** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectAndItemsNullableProp** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectItemsNullable** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/NumberOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/NumberOnly.md new file mode 100644 index 00000000000..41e8b82470b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/NumberOnly.md @@ -0,0 +1,10 @@ + +# NumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justNumber** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Order.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Order.md new file mode 100644 index 00000000000..5112f08958d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Order.md @@ -0,0 +1,22 @@ + +# Order + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**petId** | **kotlin.Long** | | [optional] +**quantity** | **kotlin.Int** | | [optional] +**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**status** | [**inline**](#StatusEnum) | Order Status | [optional] +**complete** | **kotlin.Boolean** | | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | placed, approved, delivered + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterComposite.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterComposite.md new file mode 100644 index 00000000000..5296703674d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterComposite.md @@ -0,0 +1,12 @@ + +# OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] +**myString** | **kotlin.String** | | [optional] +**myBoolean** | **kotlin.Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterEnum.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterEnum.md new file mode 100644 index 00000000000..9e7ecb9499a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterEnum.md @@ -0,0 +1,14 @@ + +# OuterEnum + +## Enum + + + * `placed` (value: `"placed"`) + + * `approved` (value: `"approved"`) + + * `delivered` (value: `"delivered"`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterEnumDefaultValue.md new file mode 100644 index 00000000000..821d297a001 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterEnumDefaultValue.md @@ -0,0 +1,14 @@ + +# OuterEnumDefaultValue + +## Enum + + + * `placed` (value: `"placed"`) + + * `approved` (value: `"approved"`) + + * `delivered` (value: `"delivered"`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterEnumInteger.md new file mode 100644 index 00000000000..b40f6e4b7ef --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterEnumInteger.md @@ -0,0 +1,14 @@ + +# OuterEnumInteger + +## Enum + + + * `_0` (value: `0`) + + * `_1` (value: `1`) + + * `_2` (value: `2`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 00000000000..c2fb3ee41d7 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,14 @@ + +# OuterEnumIntegerDefaultValue + +## Enum + + + * `_0` (value: `0`) + + * `_1` (value: `1`) + + * `_2` (value: `2`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Pet.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Pet.md new file mode 100644 index 00000000000..70c340005d1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Pet.md @@ -0,0 +1,22 @@ + +# Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | | +**photoUrls** | **kotlin.Array<kotlin.String>** | | +**id** | **kotlin.Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**tags** | [**kotlin.Array<Tag>**](Tag.md) | | [optional] +**status** | [**inline**](#StatusEnum) | pet status in the store | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | available, pending, sold + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/PetApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/PetApi.md new file mode 100644 index 00000000000..576d2f04ca8 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/PetApi.md @@ -0,0 +1,457 @@ +# 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 +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +try { + apiInstance.addPet(pet) +} catch (e: ClientException) { + println("4xx response calling PetApi#addPet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#addPet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | Pet id to delete +val apiKey : kotlin.String = apiKey_example // kotlin.String | +try { + apiInstance.deletePet(petId, apiKey) +} catch (e: ClientException) { + println("4xx response calling PetApi#deletePet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#deletePet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| Pet id to delete | + **apiKey** | **kotlin.String**| | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **findPetsByStatus** +> kotlin.Array<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val status : kotlin.Array = // kotlin.Array | Status values that need to be considered for filter +try { + val result : kotlin.Array = apiInstance.findPetsByStatus(status) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#findPetsByStatus") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#findPetsByStatus") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + +### Return type + +[**kotlin.Array<Pet>**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **findPetsByTags** +> kotlin.Array<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val tags : kotlin.Array = // kotlin.Array | Tags to filter by +try { + val result : kotlin.Array = apiInstance.findPetsByTags(tags) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#findPetsByTags") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#findPetsByTags") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Tags to filter by | + +### Return type + +[**kotlin.Array<Pet>**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to return +try { + val result : Pet = apiInstance.getPetById(petId) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#getPetById") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#getPetById") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **updatePet** +> updatePet(pet) + +Update an existing pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +try { + apiInstance.updatePet(pet) +} catch (e: ClientException) { + println("4xx response calling PetApi#updatePet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#updatePet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated +val name : kotlin.String = name_example // kotlin.String | Updated name of the pet +val status : kotlin.String = status_example // kotlin.String | Updated status of the pet +try { + apiInstance.updatePetWithForm(petId, name, status) +} catch (e: ClientException) { + println("4xx response calling PetApi#updatePetWithForm") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#updatePetWithForm") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet that needs to be updated | + **name** | **kotlin.String**| Updated name of the pet | [optional] + **status** | **kotlin.String**| Updated status of the pet | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **uploadFile** +> ApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update +val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server +val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload +try { + val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#uploadFile") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#uploadFile") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to update | + **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] + **file** | **java.io.File**| file to upload | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +# **uploadFileWithRequiredFile** +> ApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update +val requiredFile : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload +val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server +try { + val result : ApiResponse = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#uploadFileWithRequiredFile") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#uploadFileWithRequiredFile") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to update | + **requiredFile** | **java.io.File**| file to upload | + **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ReadOnlyFirst.md new file mode 100644 index 00000000000..825f613f090 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ReadOnlyFirst.md @@ -0,0 +1,11 @@ + +# ReadOnlyFirst + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **kotlin.String** | | [optional] [readonly] +**baz** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Return.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Return.md new file mode 100644 index 00000000000..a5437240dc3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Return.md @@ -0,0 +1,10 @@ + +# Return + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**`return`** | **kotlin.Int** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/SpecialModelName.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/SpecialModelName.md new file mode 100644 index 00000000000..282649449d9 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/SpecialModelName.md @@ -0,0 +1,10 @@ + +# SpecialModelname + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **kotlin.Long** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/StoreApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/StoreApi.md new file mode 100644 index 00000000000..55bd8afdbc0 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/StoreApi.md @@ -0,0 +1,196 @@ +# 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 +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted +try { + apiInstance.deleteOrder(orderId) +} catch (e: ClientException) { + println("4xx response calling StoreApi#deleteOrder") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#deleteOrder") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.String**| ID of the order that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **getInventory** +> kotlin.collections.Map<kotlin.String, kotlin.Int> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +try { + val result : kotlin.collections.Map = apiInstance.getInventory() + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#getInventory") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#getInventory") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**kotlin.collections.Map<kotlin.String, kotlin.Int>** + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched +try { + val result : Order = apiInstance.getOrderById(orderId) + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#getOrderById") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#getOrderById") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **placeOrder** +> Order placeOrder(order) + +Place an order for a pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val order : Order = // Order | order placed for purchasing the pet +try { + val result : Order = apiInstance.placeOrder(order) + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#placeOrder") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#placeOrder") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/xml, application/json + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Tag.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Tag.md new file mode 100644 index 00000000000..60ce1bcdbad --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Tag.md @@ -0,0 +1,11 @@ + +# Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**name** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/User.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/User.md new file mode 100644 index 00000000000..e801729b5ed --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/User.md @@ -0,0 +1,17 @@ + +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**username** | **kotlin.String** | | [optional] +**firstName** | **kotlin.String** | | [optional] +**lastName** | **kotlin.String** | | [optional] +**email** | **kotlin.String** | | [optional] +**password** | **kotlin.String** | | [optional] +**phone** | **kotlin.String** | | [optional] +**userStatus** | **kotlin.Int** | User Status | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/UserApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/UserApi.md new file mode 100644 index 00000000000..dbf78e81eb2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/UserApi.md @@ -0,0 +1,376 @@ +# 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 +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : User = // User | Created user object +try { + apiInstance.createUser(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md)| Created user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(user) + +Creates list of users with given input array + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : kotlin.Array = // kotlin.Array | List of user object +try { + apiInstance.createUsersWithArrayInput(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUsersWithArrayInput") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUsersWithArrayInput") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**kotlin.Array<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 + + +# **createUsersWithListInput** +> createUsersWithListInput(user) + +Creates list of users with given input array + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : kotlin.Array = // kotlin.Array | List of user object +try { + apiInstance.createUsersWithListInput(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUsersWithListInput") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUsersWithListInput") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**kotlin.Array<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 + + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The name that needs to be deleted +try { + apiInstance.deleteUser(username) +} catch (e: ClientException) { + println("4xx response calling UserApi#deleteUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#deleteUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The name that needs to be fetched. Use user1 for testing. +try { + val result : User = apiInstance.getUserByName(username) + println(result) +} catch (e: ClientException) { + println("4xx response calling UserApi#getUserByName") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#getUserByName") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **loginUser** +> kotlin.String loginUser(username, password) + +Logs user into the system + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The user name for login +val password : kotlin.String = password_example // kotlin.String | The password for login in clear text +try { + val result : kotlin.String = apiInstance.loginUser(username, password) + println(result) +} catch (e: ClientException) { + println("4xx response calling UserApi#loginUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#loginUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The user name for login | + **password** | **kotlin.String**| The password for login in clear text | + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +try { + apiInstance.logoutUser() +} catch (e: ClientException) { + println("4xx response calling UserApi#logoutUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#logoutUser") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **updateUser** +> updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | name that need to be deleted +val user : User = // User | Updated user object +try { + apiInstance.updateUser(username, user) +} catch (e: ClientException) { + println("4xx response calling UserApi#updateUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#updateUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| name that need to be deleted | + **user** | [**User**](User.md)| Updated user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/settings.gradle b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/settings.gradle new file mode 100644 index 00000000000..94448508bc5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/settings.gradle @@ -0,0 +1,2 @@ + +rootProject.name = 'kotlin-petstore-coroutines-client' \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt new file mode 100644 index 00000000000..af9af8a9f2d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt @@ -0,0 +1,15 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody + +import org.openapitools.client.models.Client + +interface AnotherFakeApi { + @PATCH("/another-fake/dummy") + suspend fun call123testSpecialTags(@Body client: Client): Client + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt new file mode 100644 index 00000000000..74104da77ca --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -0,0 +1,15 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody + +import org.openapitools.client.models.InlineResponseDefault + +interface DefaultApi { + @GET("/foo") + suspend fun fooGet(): InlineResponseDefault + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt new file mode 100644 index 00000000000..e32a633abb6 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt @@ -0,0 +1,65 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody + +import org.openapitools.client.models.Client +import org.openapitools.client.models.FileSchemaTestClass +import org.openapitools.client.models.HealthCheckResult +import org.openapitools.client.models.OuterComposite +import org.openapitools.client.models.Pet +import org.openapitools.client.models.User + +interface FakeApi { + @GET("/fake/health") + suspend fun fakeHealthGet(): HealthCheckResult + + @GET("/fake/http-signature-test") + suspend fun fakeHttpSignatureTest(@Body pet: Pet, @Query("query_1") query1: kotlin.String, @Header("header_1") header1: kotlin.String): Unit + + @POST("/fake/outer/boolean") + suspend fun fakeOuterBooleanSerialize(@Body body: kotlin.Boolean): kotlin.Boolean + + @POST("/fake/outer/composite") + suspend fun fakeOuterCompositeSerialize(@Body outerComposite: OuterComposite): OuterComposite + + @POST("/fake/outer/number") + suspend fun fakeOuterNumberSerialize(@Body body: java.math.BigDecimal): java.math.BigDecimal + + @POST("/fake/outer/string") + suspend fun fakeOuterStringSerialize(@Body body: kotlin.String): kotlin.String + + @PUT("/fake/body-with-file-schema") + suspend fun testBodyWithFileSchema(@Body fileSchemaTestClass: FileSchemaTestClass): Unit + + @PUT("/fake/body-with-query-params") + suspend fun testBodyWithQueryParams(@Query("query") query: kotlin.String, @Body user: User): Unit + + @PATCH("/fake") + suspend fun testClientModel(@Body client: Client): Client + + @FormUrlEncoded + @POST("/fake") + suspend fun testEndpointParameters(@Field("number") number: java.math.BigDecimal, @Field("double") double: kotlin.Double, @Field("pattern_without_delimiter") patternWithoutDelimiter: kotlin.String, @Field("byte") byte: kotlin.ByteArray, @Field("integer") integer: kotlin.Int, @Field("int32") int32: kotlin.Int, @Field("int64") int64: kotlin.Long, @Field("float") float: kotlin.Float, @Field("string") string: kotlin.String, @Field("binary") binary: MultipartBody.Part, @Field("date") date: java.time.LocalDate, @Field("dateTime") dateTime: java.time.OffsetDateTime, @Field("password") password: kotlin.String, @Field("callback") paramCallback: kotlin.String): Unit + + @FormUrlEncoded + @GET("/fake") + suspend fun testEnumParameters(@Header("enum_header_string_array") enumHeaderStringArray: kotlin.Array, @Header("enum_header_string") enumHeaderString: kotlin.String, @Query("enum_query_string_array") enumQueryStringArray: kotlin.Array, @Query("enum_query_string") enumQueryString: kotlin.String, @Query("enum_query_integer") enumQueryInteger: kotlin.Int, @Query("enum_query_double") enumQueryDouble: kotlin.Double, @Field("enum_form_string_array") enumFormStringArray: kotlin.Array, @Field("enum_form_string") enumFormString: kotlin.String): Unit + + @DELETE("/fake") + suspend fun testGroupParameters(@Query("required_string_group") requiredStringGroup: kotlin.Int, @Header("required_boolean_group") requiredBooleanGroup: kotlin.Boolean, @Query("required_int64_group") requiredInt64Group: kotlin.Long, @Query("string_group") stringGroup: kotlin.Int, @Header("boolean_group") booleanGroup: kotlin.Boolean, @Query("int64_group") int64Group: kotlin.Long): Unit + + @POST("/fake/inline-additionalProperties") + suspend fun testInlineAdditionalProperties(@Body requestBody: kotlin.collections.Map): Unit + + @FormUrlEncoded + @GET("/fake/jsonFormData") + suspend fun testJsonFormData(@Field("param") param: kotlin.String, @Field("param2") param2: kotlin.String): Unit + + @PUT("/fake/test-query-paramters") + suspend fun testQueryParameterCollectionFormat(@Query("pipe") pipe: kotlin.Array, @Query("ioutil") ioutil: CSVParams, @Query("http") http: SPACEParams, @Query("url") url: CSVParams, @Query("context") context: kotlin.Array): Unit + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt new file mode 100644 index 00000000000..12d94ffec19 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt @@ -0,0 +1,15 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody + +import org.openapitools.client.models.Client + +interface FakeClassnameTags123Api { + @PATCH("/fake_classname_test") + suspend fun testClassname(@Body client: Client): Client + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt new file mode 100644 index 00000000000..9c0ceaaef45 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -0,0 +1,44 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody + +import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.Pet + +interface PetApi { + @POST("/pet") + suspend fun addPet(@Body pet: Pet): Unit + + @DELETE("/pet/{petId}") + suspend fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String): Unit + + @GET("/pet/findByStatus") + suspend fun findPetsByStatus(@Query("status") status: CSVParams): kotlin.Array + + @Deprecated("This api was deprecated") + @GET("/pet/findByTags") + suspend fun findPetsByTags(@Query("tags") tags: CSVParams): kotlin.Array + + @GET("/pet/{petId}") + suspend fun getPetById(@Path("petId") petId: kotlin.Long): Pet + + @PUT("/pet") + suspend fun updatePet(@Body pet: Pet): Unit + + @FormUrlEncoded + @POST("/pet/{petId}") + suspend fun updatePetWithForm(@Path("petId") petId: kotlin.Long, @Field("name") name: kotlin.String, @Field("status") status: kotlin.String): Unit + + @Multipart + @POST("/pet/{petId}/uploadImage") + suspend fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String, @Part file: MultipartBody.Part): ApiResponse + + @Multipart + @POST("/fake/{petId}/uploadImageWithRequiredFile") + suspend fun uploadFileWithRequiredFile(@Path("petId") petId: kotlin.Long, @Part requiredFile: MultipartBody.Part, @Part("additionalMetadata") additionalMetadata: kotlin.String): ApiResponse + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt new file mode 100644 index 00000000000..8d434e5589e --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -0,0 +1,24 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody + +import org.openapitools.client.models.Order + +interface StoreApi { + @DELETE("/store/order/{order_id}") + suspend fun deleteOrder(@Path("order_id") orderId: kotlin.String): Unit + + @GET("/store/inventory") + suspend fun getInventory(): kotlin.collections.Map + + @GET("/store/order/{order_id}") + suspend fun getOrderById(@Path("order_id") orderId: kotlin.Long): Order + + @POST("/store/order") + suspend fun placeOrder(@Body order: Order): Order + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt new file mode 100644 index 00000000000..88ba45486a4 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -0,0 +1,36 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody + +import org.openapitools.client.models.User + +interface UserApi { + @POST("/user") + suspend fun createUser(@Body user: User): Unit + + @POST("/user/createWithArray") + suspend fun createUsersWithArrayInput(@Body user: kotlin.Array): Unit + + @POST("/user/createWithList") + suspend fun createUsersWithListInput(@Body user: kotlin.Array): Unit + + @DELETE("/user/{username}") + suspend fun deleteUser(@Path("username") username: kotlin.String): Unit + + @GET("/user/{username}") + suspend fun getUserByName(@Path("username") username: kotlin.String): User + + @GET("/user/login") + suspend fun loginUser(@Query("username") username: kotlin.String, @Query("password") password: kotlin.String): kotlin.String + + @GET("/user/logout") + suspend fun logoutUser(): Unit + + @PUT("/user/{username}") + suspend fun updateUser(@Path("username") username: kotlin.String, @Body user: User): Unit + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt new file mode 100644 index 00000000000..085d78c72a5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -0,0 +1,40 @@ +package org.openapitools.client.infrastructure + +import okhttp3.OkHttpClient +import retrofit2.Retrofit +import retrofit2.converter.scalars.ScalarsConverterFactory +import retrofit2.converter.gson.GsonConverterFactory + +class ApiClient( + private var baseUrl: String = defaultBasePath, + private var okHttpClient: OkHttpClient +) { + companion object { + @JvmStatic + val defaultBasePath: String by lazy { + System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") + } + } + + init { + normalizeBaseUrl() + } + + val retrofitBuilder: Retrofit.Builder by lazy { + + Retrofit.Builder() + .baseUrl(baseUrl) + .addConverterFactory(ScalarsConverterFactory.create()) + .addConverterFactory(GsonConverterFactory.create(Serializer.gson)) + } + + fun createService(serviceClass: Class): S { + return retrofitBuilder.client(okHttpClient).build().create(serviceClass) + } + + private fun normalizeBaseUrl() { + if (!baseUrl.endsWith("/")) { + baseUrl += "/" + } + } +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt new file mode 100644 index 00000000000..6120b081929 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -0,0 +1,33 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException + +class ByteArrayAdapter : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: ByteArray?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(String(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): ByteArray? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return out.nextString().toByteArray() + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt new file mode 100644 index 00000000000..001e99325d2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/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/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt new file mode 100644 index 00000000000..c5d330ac075 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt @@ -0,0 +1,37 @@ +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/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt new file mode 100644 index 00000000000..30ef6697183 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.LocalDate +import java.time.format.DateTimeFormatter + +class LocalDateAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: LocalDate?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): LocalDate? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return LocalDate.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt new file mode 100644 index 00000000000..3ad781c66ca --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter + +class LocalDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: LocalDateTime?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): LocalDateTime? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return LocalDateTime.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt new file mode 100644 index 00000000000..e615135c9cc --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.OffsetDateTime +import java.time.format.DateTimeFormatter + +class OffsetDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: OffsetDateTime?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): OffsetDateTime? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return OffsetDateTime.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt new file mode 100644 index 00000000000..6465f148553 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -0,0 +1,24 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.Gson +import com.google.gson.GsonBuilder +import java.time.LocalDate +import java.time.LocalDateTime +import java.time.OffsetDateTime +import java.util.UUID +import java.util.Date + +object Serializer { + @JvmStatic + val gsonBuilder: GsonBuilder = GsonBuilder() + .registerTypeAdapter(Date::class.java, DateAdapter()) + .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) + .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) + .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) + .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) + + @JvmStatic + val gson: Gson by lazy { + gsonBuilder.create() + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt new file mode 100644 index 00000000000..6d216739f0b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param mapProperty + * @param mapOfMapProperty + */ + +data class AdditionalPropertiesClass ( + @SerializedName("map_property") + val mapProperty: kotlin.collections.Map? = null, + @SerializedName("map_of_map_property") + val mapOfMapProperty: kotlin.collections.Map>? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Animal.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Animal.kt new file mode 100644 index 00000000000..86992f00d6a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Animal.kt @@ -0,0 +1,33 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param className + * @param color + */ + +interface Animal : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + @get:SerializedName("className") + val className: kotlin.String + @get:SerializedName("color") + val color: kotlin.String? +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt new file mode 100644 index 00000000000..15ea8f6ce57 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -0,0 +1,37 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @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/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt new file mode 100644 index 00000000000..02723cb9dcd --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param arrayArrayNumber + */ + +data class ArrayOfArrayOfNumberOnly ( + @SerializedName("ArrayArrayNumber") + val arrayArrayNumber: kotlin.Array>? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt new file mode 100644 index 00000000000..afde31b7ff4 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param arrayNumber + */ + +data class ArrayOfNumberOnly ( + @SerializedName("ArrayNumber") + val arrayNumber: kotlin.Array? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt new file mode 100644 index 00000000000..d9946e24ba4 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt @@ -0,0 +1,38 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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.ReadOnlyFirst + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param arrayOfString + * @param arrayArrayOfInteger + * @param arrayArrayOfModel + */ + +data class ArrayTest ( + @SerializedName("array_of_string") + val arrayOfString: kotlin.Array? = null, + @SerializedName("array_array_of_integer") + val arrayArrayOfInteger: kotlin.Array>? = null, + @SerializedName("array_array_of_model") + val arrayArrayOfModel: kotlin.Array>? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Capitalization.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Capitalization.kt new file mode 100644 index 00000000000..a7c7d3c9a76 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Capitalization.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param smallCamel + * @param capitalCamel + * @param smallSnake + * @param capitalSnake + * @param scAETHFlowPoints + * @param ATT_NAME Name of the pet + */ + +data class Capitalization ( + @SerializedName("smallCamel") + val smallCamel: kotlin.String? = null, + @SerializedName("CapitalCamel") + val capitalCamel: kotlin.String? = null, + @SerializedName("small_Snake") + val smallSnake: kotlin.String? = null, + @SerializedName("Capital_Snake") + val capitalSnake: kotlin.String? = null, + @SerializedName("SCA_ETH_Flow_Points") + val scAETHFlowPoints: kotlin.String? = null, + /* Name of the pet */ + @SerializedName("ATT_NAME") + val ATT_NAME: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Cat.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Cat.kt new file mode 100644 index 00000000000..3c0b6063ce1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Cat.kt @@ -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.models + +import org.openapitools.client.models.Animal +import org.openapitools.client.models.CatAllOf + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param className + * @param color + * @param declawed + */ + +data class Cat ( + @SerializedName("className") + override val className: kotlin.String, + @SerializedName("color") + override val color: kotlin.String? = null, + @SerializedName("declawed") + val declawed: kotlin.Boolean? = null +) : Animal, Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt new file mode 100644 index 00000000000..7b42c1e2f51 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param declawed + */ + +data class CatAllOf ( + @SerializedName("declawed") + val declawed: kotlin.Boolean? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt new file mode 100644 index 00000000000..eddd17dc023 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param name + * @param id + */ + +data class Category ( + @SerializedName("name") + val name: kotlin.String, + @SerializedName("id") + val id: kotlin.Long? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ClassModel.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ClassModel.kt new file mode 100644 index 00000000000..d4ca6d61241 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ClassModel.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * Model for testing model with \"_class\" property + * @param propertyClass + */ + +data class ClassModel ( + @SerializedName("_class") + val propertyClass: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Client.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Client.kt new file mode 100644 index 00000000000..2823f40b88b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Client.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param client + */ + +data class Client ( + @SerializedName("client") + val client: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Dog.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Dog.kt new file mode 100644 index 00000000000..fbc06cf1dd6 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Dog.kt @@ -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.models + +import org.openapitools.client.models.Animal +import org.openapitools.client.models.DogAllOf + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param className + * @param color + * @param breed + */ + +data class Dog ( + @SerializedName("className") + override val className: kotlin.String, + @SerializedName("color") + override val color: kotlin.String? = null, + @SerializedName("breed") + val breed: kotlin.String? = null +) : Animal, Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt new file mode 100644 index 00000000000..c422756a65f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param breed + */ + +data class DogAllOf ( + @SerializedName("breed") + val breed: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt new file mode 100644 index 00000000000..8ffe63f244b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param justSymbol + * @param arrayEnum + */ + +data class EnumArrays ( + @SerializedName("just_symbol") + val justSymbol: EnumArrays.JustSymbol? = null, + @SerializedName("array_enum") + val arrayEnum: kotlin.Array? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * + * Values: greaterThanEqual,dollar + */ + + enum class JustSymbol(val value: kotlin.String){ + @SerializedName(value = ">=") greaterThanEqual(">="), + @SerializedName(value = "$") dollar("$"); + } + /** + * + * Values: fish,crab + */ + + enum class ArrayEnum(val value: kotlin.String){ + @SerializedName(value = "fish") fish("fish"), + @SerializedName(value = "crab") crab("crab"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/EnumClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/EnumClass.kt new file mode 100644 index 00000000000..2eccf5d72fa --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/EnumClass.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 + +/** +* +* Values: abc,minusEfg,leftParenthesisXyzRightParenthesis +*/ + +enum class EnumClass(val value: kotlin.String){ + + + @SerializedName(value = "_abc") + abc("_abc"), + + + @SerializedName(value = "-efg") + minusEfg("-efg"), + + + @SerializedName(value = "(xyz)") + leftParenthesisXyzRightParenthesis("(xyz)"); + + + + /** + 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/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/EnumTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/EnumTest.kt new file mode 100644 index 00000000000..a939ed3f41a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/EnumTest.kt @@ -0,0 +1,94 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.OuterEnum +import org.openapitools.client.models.OuterEnumDefaultValue +import org.openapitools.client.models.OuterEnumInteger +import org.openapitools.client.models.OuterEnumIntegerDefaultValue + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param enumStringRequired + * @param enumString + * @param enumInteger + * @param enumNumber + * @param outerEnum + * @param outerEnumInteger + * @param outerEnumDefaultValue + * @param outerEnumIntegerDefaultValue + */ + +data class EnumTest ( + @SerializedName("enum_string_required") + val enumStringRequired: EnumTest.EnumStringRequired, + @SerializedName("enum_string") + val enumString: EnumTest.EnumString? = null, + @SerializedName("enum_integer") + val enumInteger: EnumTest.EnumInteger? = null, + @SerializedName("enum_number") + val enumNumber: EnumTest.EnumNumber? = null, + @SerializedName("outerEnum") + val outerEnum: OuterEnum? = null, + @SerializedName("outerEnumInteger") + val outerEnumInteger: OuterEnumInteger? = null, + @SerializedName("outerEnumDefaultValue") + val outerEnumDefaultValue: OuterEnumDefaultValue? = null, + @SerializedName("outerEnumIntegerDefaultValue") + val outerEnumIntegerDefaultValue: OuterEnumIntegerDefaultValue? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * + * Values: uPPER,lower,eMPTY + */ + + enum class EnumStringRequired(val value: kotlin.String){ + @SerializedName(value = "UPPER") uPPER("UPPER"), + @SerializedName(value = "lower") lower("lower"), + @SerializedName(value = "") eMPTY(""); + } + /** + * + * Values: uPPER,lower,eMPTY + */ + + enum class EnumString(val value: kotlin.String){ + @SerializedName(value = "UPPER") uPPER("UPPER"), + @SerializedName(value = "lower") lower("lower"), + @SerializedName(value = "") eMPTY(""); + } + /** + * + * Values: _1,minus1 + */ + + enum class EnumInteger(val value: kotlin.Int){ + @SerializedName(value = "1") _1(1), + @SerializedName(value = "-1") minus1(-1); + } + /** + * + * Values: _1period1,minus1Period2 + */ + + enum class EnumNumber(val value: kotlin.Double){ + @SerializedName(value = "1.1") _1period1(1.1), + @SerializedName(value = "-1.2") minus1Period2(-1.2); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt new file mode 100644 index 00000000000..8ccd536e097 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param file + * @param files + */ + +data class FileSchemaTestClass ( + @SerializedName("file") + val file: java.io.File? = null, + @SerializedName("files") + val files: kotlin.Array? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Foo.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Foo.kt new file mode 100644 index 00000000000..eac43b98525 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Foo.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param bar + */ + +data class Foo ( + @SerializedName("bar") + val bar: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/FormatTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/FormatTest.kt new file mode 100644 index 00000000000..f8f4fd03128 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/FormatTest.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param number + * @param byte + * @param date + * @param password + * @param integer + * @param int32 + * @param int64 + * @param float + * @param double + * @param string + * @param binary + * @param dateTime + * @param uuid + * @param patternWithDigits A string that is a 10 digit number. Can have leading zeros. + * @param patternWithDigitsAndDelimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + */ + +data class FormatTest ( + @SerializedName("number") + val number: java.math.BigDecimal, + @SerializedName("byte") + val byte: kotlin.ByteArray, + @SerializedName("date") + val date: java.time.LocalDate, + @SerializedName("password") + val password: kotlin.String, + @SerializedName("integer") + val integer: kotlin.Int? = null, + @SerializedName("int32") + val int32: kotlin.Int? = null, + @SerializedName("int64") + val int64: kotlin.Long? = null, + @SerializedName("float") + val float: kotlin.Float? = null, + @SerializedName("double") + val double: kotlin.Double? = null, + @SerializedName("string") + val string: kotlin.String? = null, + @SerializedName("binary") + val binary: java.io.File? = null, + @SerializedName("dateTime") + val dateTime: java.time.OffsetDateTime? = null, + @SerializedName("uuid") + val uuid: java.util.UUID? = null, + /* A string that is a 10 digit number. Can have leading zeros. */ + @SerializedName("pattern_with_digits") + val patternWithDigits: kotlin.String? = null, + /* A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. */ + @SerializedName("pattern_with_digits_and_delimiter") + val patternWithDigitsAndDelimiter: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt new file mode 100644 index 00000000000..e70f3360998 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param bar + * @param foo + */ + +data class HasOnlyReadOnly ( + @SerializedName("bar") + val bar: kotlin.String? = null, + @SerializedName("foo") + val foo: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt new file mode 100644 index 00000000000..5ea4977b7cb --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + * @param nullableMessage + */ + +data class HealthCheckResult ( + @SerializedName("NullableMessage") + val nullableMessage: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject.kt new file mode 100644 index 00000000000..e513221c62b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param name Updated name of the pet + * @param status Updated status of the pet + */ + +data class InlineObject ( + /* Updated name of the pet */ + @SerializedName("name") + val name: kotlin.String? = null, + /* Updated status of the pet */ + @SerializedName("status") + val status: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt new file mode 100644 index 00000000000..183929c471f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + */ + +data class InlineObject1 ( + /* Additional data to pass to server */ + @SerializedName("additionalMetadata") + val additionalMetadata: kotlin.String? = null, + /* file to upload */ + @SerializedName("file") + val file: java.io.File? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt new file mode 100644 index 00000000000..29c4d228fd8 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt @@ -0,0 +1,55 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param enumFormStringArray Form parameter enum test (string array) + * @param enumFormString Form parameter enum test (string) + */ + +data class InlineObject2 ( + /* Form parameter enum test (string array) */ + @SerializedName("enum_form_string_array") + val enumFormStringArray: kotlin.Array? = null, + /* Form parameter enum test (string) */ + @SerializedName("enum_form_string") + val enumFormString: InlineObject2.EnumFormString? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * Form parameter enum test (string array) + * Values: greaterThan,dollar + */ + + enum class EnumFormStringArray(val value: kotlin.String){ + @SerializedName(value = ">") greaterThan(">"), + @SerializedName(value = "$") dollar("$"); + } + /** + * Form parameter enum test (string) + * Values: abc,minusEfg,leftParenthesisXyzRightParenthesis + */ + + enum class EnumFormString(val value: kotlin.String){ + @SerializedName(value = "_abc") abc("_abc"), + @SerializedName(value = "-efg") minusEfg("-efg"), + @SerializedName(value = "(xyz)") leftParenthesisXyzRightParenthesis("(xyz)"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt new file mode 100644 index 00000000000..a5734ebed46 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param number None + * @param double None + * @param patternWithoutDelimiter None + * @param byte None + * @param integer None + * @param int32 None + * @param int64 None + * @param float None + * @param string None + * @param binary None + * @param date None + * @param dateTime None + * @param password None + * @param callback None + */ + +data class InlineObject3 ( + /* None */ + @SerializedName("number") + val number: java.math.BigDecimal, + /* None */ + @SerializedName("double") + val double: kotlin.Double, + /* None */ + @SerializedName("pattern_without_delimiter") + val patternWithoutDelimiter: kotlin.String, + /* None */ + @SerializedName("byte") + val byte: kotlin.ByteArray, + /* None */ + @SerializedName("integer") + val integer: kotlin.Int? = null, + /* None */ + @SerializedName("int32") + val int32: kotlin.Int? = null, + /* None */ + @SerializedName("int64") + val int64: kotlin.Long? = null, + /* None */ + @SerializedName("float") + val float: kotlin.Float? = null, + /* None */ + @SerializedName("string") + val string: kotlin.String? = null, + /* None */ + @SerializedName("binary") + val binary: java.io.File? = null, + /* None */ + @SerializedName("date") + val date: java.time.LocalDate? = null, + /* None */ + @SerializedName("dateTime") + val dateTime: java.time.OffsetDateTime? = null, + /* None */ + @SerializedName("password") + val password: kotlin.String? = null, + /* None */ + @SerializedName("callback") + val callback: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt new file mode 100644 index 00000000000..488f57faff3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param param field1 + * @param param2 field2 + */ + +data class InlineObject4 ( + /* field1 */ + @SerializedName("param") + val param: kotlin.String, + /* field2 */ + @SerializedName("param2") + val param2: kotlin.String +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt new file mode 100644 index 00000000000..1bd7d0c64b8 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param requiredFile file to upload + * @param additionalMetadata Additional data to pass to server + */ + +data class InlineObject5 ( + /* file to upload */ + @SerializedName("requiredFile") + val requiredFile: java.io.File, + /* Additional data to pass to server */ + @SerializedName("additionalMetadata") + val additionalMetadata: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt new file mode 100644 index 00000000000..0252304ee84 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt @@ -0,0 +1,32 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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.Foo + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param string + */ + +data class InlineResponseDefault ( + @SerializedName("string") + val string: Foo? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/List.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/List.kt new file mode 100644 index 00000000000..b7c9f9b029b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/List.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param `123minusList` + */ + +data class List ( + @SerializedName("123-list") + val `123minusList`: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/MapTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/MapTest.kt new file mode 100644 index 00000000000..768f0a76603 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/MapTest.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param mapMapOfString + * @param mapOfEnumString + * @param directMap + * @param indirectMap + */ + +data class MapTest ( + @SerializedName("map_map_of_string") + val mapMapOfString: kotlin.collections.Map>? = null, + @SerializedName("map_of_enum_string") + val mapOfEnumString: MapTest.MapOfEnumString? = null, + @SerializedName("direct_map") + val directMap: kotlin.collections.Map? = null, + @SerializedName("indirect_map") + val indirectMap: kotlin.collections.Map? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * + * Values: uPPER,lower + */ + + enum class MapOfEnumString(val value: kotlin.String){ + @SerializedName(value = "UPPER") uPPER("UPPER"), + @SerializedName(value = "lower") lower("lower"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt new file mode 100644 index 00000000000..ec5c3ba8ead --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt @@ -0,0 +1,38 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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.Animal + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param uuid + * @param dateTime + * @param map + */ + +data class MixedPropertiesAndAdditionalPropertiesClass ( + @SerializedName("uuid") + val uuid: java.util.UUID? = null, + @SerializedName("dateTime") + val dateTime: java.time.OffsetDateTime? = null, + @SerializedName("map") + val map: kotlin.collections.Map? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Model200Response.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Model200Response.kt new file mode 100644 index 00000000000..b9506ce766f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Model200Response.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * Model for testing model name starting with number + * @param name + * @param propertyClass + */ + +data class Model200Response ( + @SerializedName("name") + val name: kotlin.Int? = null, + @SerializedName("class") + val propertyClass: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Name.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Name.kt new file mode 100644 index 00000000000..a26df5946ca --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Name.kt @@ -0,0 +1,40 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * Model for testing model name same as property name + * @param name + * @param snakeCase + * @param property + * @param `123number` + */ + +data class Name ( + @SerializedName("name") + val name: kotlin.Int, + @SerializedName("snake_case") + val snakeCase: kotlin.Int? = null, + @SerializedName("property") + val property: kotlin.String? = null, + @SerializedName("123Number") + val `123number`: kotlin.Int? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/NullableClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/NullableClass.kt new file mode 100644 index 00000000000..44ef32f2637 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/NullableClass.kt @@ -0,0 +1,64 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param integerProp + * @param numberProp + * @param booleanProp + * @param stringProp + * @param dateProp + * @param datetimeProp + * @param arrayNullableProp + * @param arrayAndItemsNullableProp + * @param arrayItemsNullable + * @param objectNullableProp + * @param objectAndItemsNullableProp + * @param objectItemsNullable + */ + +data class NullableClass ( + @SerializedName("integer_prop") + val integerProp: kotlin.Int? = null, + @SerializedName("number_prop") + val numberProp: java.math.BigDecimal? = null, + @SerializedName("boolean_prop") + val booleanProp: kotlin.Boolean? = null, + @SerializedName("string_prop") + val stringProp: kotlin.String? = null, + @SerializedName("date_prop") + val dateProp: java.time.LocalDate? = null, + @SerializedName("datetime_prop") + val datetimeProp: java.time.OffsetDateTime? = null, + @SerializedName("array_nullable_prop") + val arrayNullableProp: kotlin.Array? = null, + @SerializedName("array_and_items_nullable_prop") + val arrayAndItemsNullableProp: kotlin.Array? = null, + @SerializedName("array_items_nullable") + val arrayItemsNullable: kotlin.Array? = null, + @SerializedName("object_nullable_prop") + val objectNullableProp: kotlin.collections.Map? = null, + @SerializedName("object_and_items_nullable_prop") + val objectAndItemsNullableProp: kotlin.collections.Map? = null, + @SerializedName("object_items_nullable") + val objectItemsNullable: kotlin.collections.Map? = null +) : kotlin.collections.HashMap(), Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt new file mode 100644 index 00000000000..ca273d1f3a1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param justNumber + */ + +data class NumberOnly ( + @SerializedName("JustNumber") + val justNumber: java.math.BigDecimal? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt new file mode 100644 index 00000000000..e691b5ca8fb --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @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/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt new file mode 100644 index 00000000000..8246390507e --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt @@ -0,0 +1,37 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param myNumber + * @param myString + * @param myBoolean + */ + +data class OuterComposite ( + @SerializedName("my_number") + val myNumber: java.math.BigDecimal? = null, + @SerializedName("my_string") + val myString: kotlin.String? = null, + @SerializedName("my_boolean") + val myBoolean: kotlin.Boolean? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt new file mode 100644 index 00000000000..1c2c521eaf5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 + +/** +* +* Values: placed,approved,delivered +*/ + +enum class OuterEnum(val value: kotlin.String){ + + + @SerializedName(value = "placed") + placed("placed"), + + + @SerializedName(value = "approved") + approved("approved"), + + + @SerializedName(value = "delivered") + delivered("delivered"); + + + + /** + 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/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt new file mode 100644 index 00000000000..12c2b0a94aa --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 + +/** +* +* Values: placed,approved,delivered +*/ + +enum class OuterEnumDefaultValue(val value: kotlin.String){ + + + @SerializedName(value = "placed") + placed("placed"), + + + @SerializedName(value = "approved") + approved("approved"), + + + @SerializedName(value = "delivered") + delivered("delivered"); + + + + /** + 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/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt new file mode 100644 index 00000000000..c2ac6a4a936 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 + +/** +* +* Values: _0,_1,_2 +*/ + +enum class OuterEnumInteger(val value: kotlin.Int){ + + + @SerializedName(value = "0") + _0(0), + + + @SerializedName(value = "1") + _1(1), + + + @SerializedName(value = "2") + _2(2); + + + + /** + 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.toString() + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt new file mode 100644 index 00000000000..3066cfbae73 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 + +/** +* +* Values: _0,_1,_2 +*/ + +enum class OuterEnumIntegerDefaultValue(val value: kotlin.Int){ + + + @SerializedName(value = "0") + _0(0), + + + @SerializedName(value = "1") + _1(1), + + + @SerializedName(value = "2") + _2(2); + + + + /** + 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.toString() + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt new file mode 100644 index 00000000000..6e0b0b873d1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -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.models + +import org.openapitools.client.models.Category +import org.openapitools.client.models.Tag + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @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.Array, + @SerializedName("id") + val id: kotlin.Long? = null, + @SerializedName("category") + val category: Category? = null, + @SerializedName("tags") + val tags: kotlin.Array? = 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/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt new file mode 100644 index 00000000000..5dff54dc190 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param bar + * @param baz + */ + +data class ReadOnlyFirst ( + @SerializedName("bar") + val bar: kotlin.String? = null, + @SerializedName("baz") + val baz: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Return.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Return.kt new file mode 100644 index 00000000000..ecdce7f408f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Return.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * Model for testing reserved words + * @param `return` + */ + +data class Return ( + @SerializedName("return") + val `return`: kotlin.Int? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt new file mode 100644 index 00000000000..f67aa3c948b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket + */ + +data class SpecialModelname ( + @SerializedName("\$special[property.name]") + val dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket: kotlin.Long? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt new file mode 100644 index 00000000000..04ca1914328 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @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/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt new file mode 100644 index 00000000000..24b8c5d47ac --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @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/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/.openapi-generator-ignore b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/.openapi-generator/VERSION b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/.openapi-generator/VERSION new file mode 100644 index 00000000000..b5d898602c2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/README.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/README.md new file mode 100644 index 00000000000..b7028d917a2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/README.md @@ -0,0 +1,173 @@ +# org.openapitools.client - Kotlin client library for OpenAPI Petstore + +## Requires + +* Kotlin 1.3.41 +* Gradle 4.9 + +## Build + +First, create the gradle wrapper script: + +``` +gradle wrapper +``` + +Then, run: + +``` +./gradlew check assemble +``` + +This runs all tests and packages the library. + +## Features/Implementation Notes + +* Supports JSON inputs/outputs, File inputs, and Form inputs. +* Supports collection formats for query parameters: csv, tsv, ssv, pipes. +* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions. +* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets. + + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io: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* | [**fakeHttpSignatureTest**](docs/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication +*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 +*FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters | +*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 + + - [org.openapitools.client.models.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [org.openapitools.client.models.Animal](docs/Animal.md) + - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) + - [org.openapitools.client.models.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [org.openapitools.client.models.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [org.openapitools.client.models.ArrayTest](docs/ArrayTest.md) + - [org.openapitools.client.models.Capitalization](docs/Capitalization.md) + - [org.openapitools.client.models.Cat](docs/Cat.md) + - [org.openapitools.client.models.CatAllOf](docs/CatAllOf.md) + - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ClassModel](docs/ClassModel.md) + - [org.openapitools.client.models.Client](docs/Client.md) + - [org.openapitools.client.models.Dog](docs/Dog.md) + - [org.openapitools.client.models.DogAllOf](docs/DogAllOf.md) + - [org.openapitools.client.models.EnumArrays](docs/EnumArrays.md) + - [org.openapitools.client.models.EnumClass](docs/EnumClass.md) + - [org.openapitools.client.models.EnumTest](docs/EnumTest.md) + - [org.openapitools.client.models.FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [org.openapitools.client.models.Foo](docs/Foo.md) + - [org.openapitools.client.models.FormatTest](docs/FormatTest.md) + - [org.openapitools.client.models.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [org.openapitools.client.models.HealthCheckResult](docs/HealthCheckResult.md) + - [org.openapitools.client.models.InlineObject](docs/InlineObject.md) + - [org.openapitools.client.models.InlineObject1](docs/InlineObject1.md) + - [org.openapitools.client.models.InlineObject2](docs/InlineObject2.md) + - [org.openapitools.client.models.InlineObject3](docs/InlineObject3.md) + - [org.openapitools.client.models.InlineObject4](docs/InlineObject4.md) + - [org.openapitools.client.models.InlineObject5](docs/InlineObject5.md) + - [org.openapitools.client.models.InlineResponseDefault](docs/InlineResponseDefault.md) + - [org.openapitools.client.models.List](docs/List.md) + - [org.openapitools.client.models.MapTest](docs/MapTest.md) + - [org.openapitools.client.models.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [org.openapitools.client.models.Model200Response](docs/Model200Response.md) + - [org.openapitools.client.models.Name](docs/Name.md) + - [org.openapitools.client.models.NullableClass](docs/NullableClass.md) + - [org.openapitools.client.models.NumberOnly](docs/NumberOnly.md) + - [org.openapitools.client.models.Order](docs/Order.md) + - [org.openapitools.client.models.OuterComposite](docs/OuterComposite.md) + - [org.openapitools.client.models.OuterEnum](docs/OuterEnum.md) + - [org.openapitools.client.models.OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [org.openapitools.client.models.OuterEnumInteger](docs/OuterEnumInteger.md) + - [org.openapitools.client.models.OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) + - [org.openapitools.client.models.Pet](docs/Pet.md) + - [org.openapitools.client.models.ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [org.openapitools.client.models.Return](docs/Return.md) + - [org.openapitools.client.models.SpecialModelname](docs/SpecialModelname.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 + + +### 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 + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/build.gradle b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/build.gradle new file mode 100644 index 00000000000..94e4916b6df --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/build.gradle @@ -0,0 +1,41 @@ +group 'org.openapitools' +version '1.0.0' + +wrapper { + gradleVersion = '4.9' + distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" +} + +buildscript { + ext.kotlin_version = '1.3.61' + ext.retrofitVersion = '2.6.2' + ext.rxJavaVersion = '1.3.8' + + repositories { + maven { url "https://repo1.maven.org/maven2" } + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +apply plugin: 'kotlin' + +repositories { + maven { url "https://repo1.maven.org/maven2" } +} + +test { + useJUnitPlatform() +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + compile "com.google.code.gson:gson:2.8.6" + compile "io.reactivex:rxjava:$rxJavaVersion" + compile "com.squareup.retrofit2:adapter-rxjava:$retrofitVersion" + compile "com.squareup.retrofit2:retrofit:$retrofitVersion" + compile "com.squareup.retrofit2:converter-gson:$retrofitVersion" + compile "com.squareup.retrofit2:converter-scalars:$retrofitVersion" + testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0" +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/200Response.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/200Response.md new file mode 100644 index 00000000000..53c1edacfb8 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/200Response.md @@ -0,0 +1,11 @@ + +# Model200Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.Int** | | [optional] +**propertyClass** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..1025301ce94 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/AdditionalPropertiesClass.md @@ -0,0 +1,11 @@ + +# AdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapProperty** | **kotlin.collections.Map<kotlin.String, kotlin.String>** | | [optional] +**mapOfMapProperty** | **kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Animal.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Animal.md new file mode 100644 index 00000000000..5ce5a4972c8 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Animal.md @@ -0,0 +1,11 @@ + +# Animal + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **kotlin.String** | | +**color** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..55d482238db --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/AnotherFakeApi.md @@ -0,0 +1,56 @@ +# 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 +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = AnotherFakeApi() +val client : Client = // Client | client model +try { + val result : Client = apiInstance.call123testSpecialTags(client) + println(result) +} catch (e: ClientException) { + println("4xx response calling AnotherFakeApi#call123testSpecialTags") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling AnotherFakeApi#call123testSpecialTags") + 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 + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ApiResponse.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ApiResponse.md new file mode 100644 index 00000000000..6b4c6bf2779 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ApiResponse.md @@ -0,0 +1,12 @@ + +# ApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **kotlin.Int** | | [optional] +**type** | **kotlin.String** | | [optional] +**message** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 00000000000..23a47566420 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,10 @@ + +# ArrayOfArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayArrayNumber** | **kotlin.Array<kotlin.Array<java.math.BigDecimal>>** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ArrayOfNumberOnly.md new file mode 100644 index 00000000000..b115a5d54c2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ArrayOfNumberOnly.md @@ -0,0 +1,10 @@ + +# ArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayNumber** | [**kotlin.Array<java.math.BigDecimal>**](java.math.BigDecimal.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ArrayTest.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ArrayTest.md new file mode 100644 index 00000000000..aa0bbbe936c --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ArrayTest.md @@ -0,0 +1,12 @@ + +# ArrayTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayOfString** | **kotlin.Array<kotlin.String>** | | [optional] +**arrayArrayOfInteger** | **kotlin.Array<kotlin.Array<kotlin.Long>>** | | [optional] +**arrayArrayOfModel** | **kotlin.Array<kotlin.Array<ReadOnlyFirst>>** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Capitalization.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Capitalization.md new file mode 100644 index 00000000000..9d44a82fb7f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Capitalization.md @@ -0,0 +1,15 @@ + +# Capitalization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**smallCamel** | **kotlin.String** | | [optional] +**capitalCamel** | **kotlin.String** | | [optional] +**smallSnake** | **kotlin.String** | | [optional] +**capitalSnake** | **kotlin.String** | | [optional] +**scAETHFlowPoints** | **kotlin.String** | | [optional] +**ATT_NAME** | **kotlin.String** | Name of the pet | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Cat.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Cat.md new file mode 100644 index 00000000000..b6da7c47ced --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Cat.md @@ -0,0 +1,10 @@ + +# Cat + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **kotlin.Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/CatAllOf.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/CatAllOf.md new file mode 100644 index 00000000000..fb8883197a1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/CatAllOf.md @@ -0,0 +1,10 @@ + +# CatAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **kotlin.Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Category.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Category.md new file mode 100644 index 00000000000..1f12c3eb158 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Category.md @@ -0,0 +1,11 @@ + +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | | +**id** | **kotlin.Long** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ClassModel.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ClassModel.md new file mode 100644 index 00000000000..50ad61b51a5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ClassModel.md @@ -0,0 +1,10 @@ + +# ClassModel + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**propertyClass** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Client.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Client.md new file mode 100644 index 00000000000..11afbcf0c9f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Client.md @@ -0,0 +1,10 @@ + +# Client + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/DefaultApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/DefaultApi.md new file mode 100644 index 00000000000..784be537594 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/DefaultApi.md @@ -0,0 +1,50 @@ +# 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 +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = DefaultApi() +try { + val result : InlineResponseDefault = apiInstance.fooGet() + println(result) +} catch (e: ClientException) { + println("4xx response calling DefaultApi#fooGet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling DefaultApi#fooGet") + 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 + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Dog.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Dog.md new file mode 100644 index 00000000000..41d9c6ba0d1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Dog.md @@ -0,0 +1,10 @@ + +# Dog + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/DogAllOf.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/DogAllOf.md new file mode 100644 index 00000000000..6b14d5e9147 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/DogAllOf.md @@ -0,0 +1,10 @@ + +# DogAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/EnumArrays.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/EnumArrays.md new file mode 100644 index 00000000000..719084e5f94 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/EnumArrays.md @@ -0,0 +1,25 @@ + +# EnumArrays + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justSymbol** | [**inline**](#JustSymbolEnum) | | [optional] +**arrayEnum** | [**inline**](#kotlin.Array<ArrayEnumEnum>) | | [optional] + + + +## Enum: just_symbol +Name | Value +---- | ----- +justSymbol | >=, $ + + + +## Enum: array_enum +Name | Value +---- | ----- +arrayEnum | fish, crab + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/EnumClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/EnumClass.md new file mode 100644 index 00000000000..5ddb262871f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/EnumClass.md @@ -0,0 +1,14 @@ + +# EnumClass + +## Enum + + + * `abc` (value: `"_abc"`) + + * `minusEfg` (value: `"-efg"`) + + * `leftParenthesisXyzRightParenthesis` (value: `"(xyz)"`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/EnumTest.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/EnumTest.md new file mode 100644 index 00000000000..f0370049eb3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/EnumTest.md @@ -0,0 +1,45 @@ + +# EnumTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumStringRequired** | [**inline**](#EnumStringRequiredEnum) | | +**enumString** | [**inline**](#EnumStringEnum) | | [optional] +**enumInteger** | [**inline**](#EnumIntegerEnum) | | [optional] +**enumNumber** | [**inline**](#EnumNumberEnum) | | [optional] +**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] +**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] + + + +## Enum: enum_string_required +Name | Value +---- | ----- +enumStringRequired | UPPER, lower, + + + +## Enum: enum_string +Name | Value +---- | ----- +enumString | UPPER, lower, + + + +## Enum: enum_integer +Name | Value +---- | ----- +enumInteger | 1, -1 + + + +## Enum: enum_number +Name | Value +---- | ----- +enumNumber | 1.1, -1.2 + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FakeApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FakeApi.md new file mode 100644 index 00000000000..fb663183f92 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FakeApi.md @@ -0,0 +1,776 @@ +# 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 +[**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 | +[**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-paramters | + + + +# **fakeHealthGet** +> HealthCheckResult fakeHealthGet() + +Health check endpoint + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +try { + val result : HealthCheckResult = apiInstance.fakeHealthGet() + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeHealthGet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeHealthGet") + 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 + + +# **fakeHttpSignatureTest** +> fakeHttpSignatureTest(pet, query1, header1) + +test http signature authentication + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +val query1 : kotlin.String = query1_example // kotlin.String | query parameter +val header1 : kotlin.String = header1_example // kotlin.String | header parameter +try { + apiInstance.fakeHttpSignatureTest(pet, query1, header1) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeHttpSignatureTest") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeHttpSignatureTest") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **query1** | **kotlin.String**| query parameter | [optional] + **header1** | **kotlin.String**| header parameter | [optional] + +### Return type + +null (empty response body) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +# **fakeOuterBooleanSerialize** +> kotlin.Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val body : kotlin.Boolean = true // kotlin.Boolean | Input boolean as post body +try { + val result : kotlin.Boolean = apiInstance.fakeOuterBooleanSerialize(body) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterBooleanSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterBooleanSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **kotlin.Boolean**| Input boolean as post body | [optional] + +### Return type + +**kotlin.Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(outerComposite) + + + +Test serialization of object with outer number type + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val outerComposite : OuterComposite = // OuterComposite | Input composite as post body +try { + val result : OuterComposite = apiInstance.fakeOuterCompositeSerialize(outerComposite) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterCompositeSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterCompositeSerialize") + 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**: */* + + +# **fakeOuterNumberSerialize** +> java.math.BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val body : java.math.BigDecimal = 8.14 // java.math.BigDecimal | Input number as post body +try { + val result : java.math.BigDecimal = apiInstance.fakeOuterNumberSerialize(body) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterNumberSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterNumberSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **java.math.BigDecimal**| Input number as post body | [optional] + +### Return type + +[**java.math.BigDecimal**](java.math.BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +# **fakeOuterStringSerialize** +> kotlin.String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val body : kotlin.String = body_example // kotlin.String | Input string as post body +try { + val result : kotlin.String = apiInstance.fakeOuterStringSerialize(body) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterStringSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterStringSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **kotlin.String**| Input string as post body | [optional] + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +# **testBodyWithFileSchema** +> testBodyWithFileSchema(fileSchemaTestClass) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val fileSchemaTestClass : FileSchemaTestClass = // FileSchemaTestClass | +try { + apiInstance.testBodyWithFileSchema(fileSchemaTestClass) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testBodyWithFileSchema") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testBodyWithFileSchema") + 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 + + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val query : kotlin.String = query_example // kotlin.String | +val user : User = // User | +try { + apiInstance.testBodyWithQueryParams(query, user) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testBodyWithQueryParams") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testBodyWithQueryParams") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **kotlin.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 + + +# **testClientModel** +> Client testClientModel(client) + +To test \"client\" model + +To test \"client\" model + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val client : Client = // Client | client model +try { + val result : Client = apiInstance.testClientModel(client) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testClientModel") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testClientModel") + 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 + + +# **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 +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val number : java.math.BigDecimal = 8.14 // java.math.BigDecimal | None +val double : kotlin.Double = 1.2 // kotlin.Double | None +val patternWithoutDelimiter : kotlin.String = patternWithoutDelimiter_example // kotlin.String | None +val byte : kotlin.ByteArray = BYTE_ARRAY_DATA_HERE // kotlin.ByteArray | None +val integer : kotlin.Int = 56 // kotlin.Int | None +val int32 : kotlin.Int = 56 // kotlin.Int | None +val int64 : kotlin.Long = 789 // kotlin.Long | None +val float : kotlin.Float = 3.4 // kotlin.Float | None +val string : kotlin.String = string_example // kotlin.String | None +val binary : java.io.File = BINARY_DATA_HERE // java.io.File | None +val date : java.time.LocalDate = 2013-10-20 // java.time.LocalDate | None +val dateTime : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | None +val password : kotlin.String = password_example // kotlin.String | None +val paramCallback : kotlin.String = paramCallback_example // kotlin.String | None +try { + apiInstance.testEndpointParameters(number, double, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, paramCallback) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testEndpointParameters") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testEndpointParameters") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **java.math.BigDecimal**| None | + **double** | **kotlin.Double**| None | + **patternWithoutDelimiter** | **kotlin.String**| None | + **byte** | **kotlin.ByteArray**| None | + **integer** | **kotlin.Int**| None | [optional] + **int32** | **kotlin.Int**| None | [optional] + **int64** | **kotlin.Long**| None | [optional] + **float** | **kotlin.Float**| None | [optional] + **string** | **kotlin.String**| None | [optional] + **binary** | **java.io.File**| None | [optional] + **date** | **java.time.LocalDate**| None | [optional] + **dateTime** | **java.time.OffsetDateTime**| None | [optional] + **password** | **kotlin.String**| None | [optional] + **paramCallback** | **kotlin.String**| None | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure http_basic_test: + ApiClient.username = "" + ApiClient.password = "" + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **testEnumParameters** +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val enumHeaderStringArray : kotlin.Array = // kotlin.Array | Header parameter enum test (string array) +val enumHeaderString : kotlin.String = enumHeaderString_example // kotlin.String | Header parameter enum test (string) +val enumQueryStringArray : kotlin.Array = // kotlin.Array | Query parameter enum test (string array) +val enumQueryString : kotlin.String = enumQueryString_example // kotlin.String | Query parameter enum test (string) +val enumQueryInteger : kotlin.Int = 56 // kotlin.Int | Query parameter enum test (double) +val enumQueryDouble : kotlin.Double = 1.2 // kotlin.Double | Query parameter enum test (double) +val enumFormStringArray : kotlin.Array = enumFormStringArray_example // kotlin.Array | Form parameter enum test (string array) +val enumFormString : kotlin.String = enumFormString_example // kotlin.String | Form parameter enum test (string) +try { + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testEnumParameters") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testEnumParameters") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumHeaderStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] + **enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to '-efg'] [enum: _abc, -efg, (xyz)] + **enumQueryStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] + **enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to '-efg'] [enum: _abc, -efg, (xyz)] + **enumQueryInteger** | **kotlin.Int**| Query parameter enum test (double) | [optional] [enum: 1, -2] + **enumQueryDouble** | **kotlin.Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to '$'] [enum: >, $] + **enumFormString** | **kotlin.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 + + +# **testGroupParameters** +> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val requiredStringGroup : kotlin.Int = 56 // kotlin.Int | Required String in group parameters +val requiredBooleanGroup : kotlin.Boolean = true // kotlin.Boolean | Required Boolean in group parameters +val requiredInt64Group : kotlin.Long = 789 // kotlin.Long | Required Integer in group parameters +val stringGroup : kotlin.Int = 56 // kotlin.Int | String in group parameters +val booleanGroup : kotlin.Boolean = true // kotlin.Boolean | Boolean in group parameters +val int64Group : kotlin.Long = 789 // kotlin.Long | Integer in group parameters +try { + apiInstance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testGroupParameters") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testGroupParameters") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requiredStringGroup** | **kotlin.Int**| Required String in group parameters | + **requiredBooleanGroup** | **kotlin.Boolean**| Required Boolean in group parameters | + **requiredInt64Group** | **kotlin.Long**| Required Integer in group parameters | + **stringGroup** | **kotlin.Int**| String in group parameters | [optional] + **booleanGroup** | **kotlin.Boolean**| Boolean in group parameters | [optional] + **int64Group** | **kotlin.Long**| Integer in group parameters | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure bearer_test: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **testInlineAdditionalProperties** +> testInlineAdditionalProperties(requestBody) + +test inline additionalProperties + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val requestBody : kotlin.collections.Map = // kotlin.collections.Map | request body +try { + apiInstance.testInlineAdditionalProperties(requestBody) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testInlineAdditionalProperties") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testInlineAdditionalProperties") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**kotlin.collections.Map<kotlin.String, kotlin.String>**](kotlin.String.md)| request body | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **testJsonFormData** +> testJsonFormData(param, param2) + +test json serialization of form data + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val param : kotlin.String = param_example // kotlin.String | field1 +val param2 : kotlin.String = param2_example // kotlin.String | field2 +try { + apiInstance.testJsonFormData(param, param2) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testJsonFormData") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testJsonFormData") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **kotlin.String**| field1 | + **param2** | **kotlin.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 + + +# **testQueryParameterCollectionFormat** +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val pipe : kotlin.Array = // kotlin.Array | +val ioutil : kotlin.Array = // kotlin.Array | +val http : kotlin.Array = // kotlin.Array | +val url : kotlin.Array = // kotlin.Array | +val context : kotlin.Array = // kotlin.Array | +try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testQueryParameterCollectionFormat") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testQueryParameterCollectionFormat") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **ioutil** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **http** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **url** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **context** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..962dfd4d2dc --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/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** +> Client testClassname(client) + +To test class name in snake case + +To test class name in snake case + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeClassnameTags123Api() +val client : Client = // Client | client model +try { + val result : Client = apiInstance.testClassname(client) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeClassnameTags123Api#testClassname") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeClassnameTags123Api#testClassname") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + + +Configure api_key_query: + ApiClient.apiKey["api_key_query"] = "" + ApiClient.apiKeyPrefix["api_key_query"] = "" + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FileSchemaTestClass.md new file mode 100644 index 00000000000..089e61862c2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FileSchemaTestClass.md @@ -0,0 +1,11 @@ + +# FileSchemaTestClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**java.io.File**](java.io.File.md) | | [optional] +**files** | [**kotlin.Array<java.io.File>**](java.io.File.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Foo.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Foo.md new file mode 100644 index 00000000000..e3e9918872b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Foo.md @@ -0,0 +1,10 @@ + +# Foo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FormatTest.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FormatTest.md new file mode 100644 index 00000000000..0357923c97a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FormatTest.md @@ -0,0 +1,24 @@ + +# FormatTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | +**byte** | **kotlin.ByteArray** | | +**date** | [**java.time.LocalDate**](java.time.LocalDate.md) | | +**password** | **kotlin.String** | | +**integer** | **kotlin.Int** | | [optional] +**int32** | **kotlin.Int** | | [optional] +**int64** | **kotlin.Long** | | [optional] +**float** | **kotlin.Float** | | [optional] +**double** | **kotlin.Double** | | [optional] +**string** | **kotlin.String** | | [optional] +**binary** | [**java.io.File**](java.io.File.md) | | [optional] +**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**uuid** | [**java.util.UUID**](java.util.UUID.md) | | [optional] +**patternWithDigits** | **kotlin.String** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**patternWithDigitsAndDelimiter** | **kotlin.String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/HasOnlyReadOnly.md new file mode 100644 index 00000000000..ed3e4750f44 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/HasOnlyReadOnly.md @@ -0,0 +1,11 @@ + +# HasOnlyReadOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **kotlin.String** | | [optional] [readonly] +**foo** | **kotlin.String** | | [optional] [readonly] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/HealthCheckResult.md new file mode 100644 index 00000000000..472dc310457 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/HealthCheckResult.md @@ -0,0 +1,10 @@ + +# HealthCheckResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nullableMessage** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject.md new file mode 100644 index 00000000000..2156c70addf --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject.md @@ -0,0 +1,11 @@ + +# InlineObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | Updated name of the pet | [optional] +**status** | **kotlin.String** | Updated status of the pet | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject1.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject1.md new file mode 100644 index 00000000000..2a77eecba2b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject1.md @@ -0,0 +1,11 @@ + +# InlineObject1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional] +**file** | [**java.io.File**](java.io.File.md) | file to upload | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject2.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject2.md new file mode 100644 index 00000000000..0720925918b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject2.md @@ -0,0 +1,25 @@ + +# InlineObject2 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumFormStringArray** | [**inline**](#kotlin.Array<EnumFormStringArrayEnum>) | Form parameter enum test (string array) | [optional] +**enumFormString** | [**inline**](#EnumFormStringEnum) | Form parameter enum test (string) | [optional] + + + +## Enum: enum_form_string_array +Name | Value +---- | ----- +enumFormStringArray | >, $ + + + +## Enum: enum_form_string +Name | Value +---- | ----- +enumFormString | _abc, -efg, (xyz) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject3.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject3.md new file mode 100644 index 00000000000..4ca6979b280 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject3.md @@ -0,0 +1,23 @@ + +# InlineObject3 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | None | +**double** | **kotlin.Double** | None | +**patternWithoutDelimiter** | **kotlin.String** | None | +**byte** | **kotlin.ByteArray** | None | +**integer** | **kotlin.Int** | None | [optional] +**int32** | **kotlin.Int** | None | [optional] +**int64** | **kotlin.Long** | None | [optional] +**float** | **kotlin.Float** | None | [optional] +**string** | **kotlin.String** | None | [optional] +**binary** | [**java.io.File**](java.io.File.md) | None | [optional] +**date** | [**java.time.LocalDate**](java.time.LocalDate.md) | None | [optional] +**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | None | [optional] +**password** | **kotlin.String** | None | [optional] +**callback** | **kotlin.String** | None | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject4.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject4.md new file mode 100644 index 00000000000..03c4daa7631 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject4.md @@ -0,0 +1,11 @@ + +# InlineObject4 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**param** | **kotlin.String** | field1 | +**param2** | **kotlin.String** | field2 | + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject5.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject5.md new file mode 100644 index 00000000000..c3c020b20f6 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject5.md @@ -0,0 +1,11 @@ + +# InlineObject5 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**requiredFile** | [**java.io.File**](java.io.File.md) | file to upload | +**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineResponseDefault.md new file mode 100644 index 00000000000..afdd81b1383 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineResponseDefault.md @@ -0,0 +1,10 @@ + +# InlineResponseDefault + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string** | [**Foo**](Foo.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/List.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/List.md new file mode 100644 index 00000000000..13a09a4c414 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/List.md @@ -0,0 +1,10 @@ + +# List + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**`123minusList`** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/MapTest.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/MapTest.md new file mode 100644 index 00000000000..8cee39e3604 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/MapTest.md @@ -0,0 +1,20 @@ + +# MapTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapMapOfString** | **kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>** | | [optional] +**mapOfEnumString** | [**inline**](#kotlin.collections.Map<kotlin.String, InnerEnum>) | | [optional] +**directMap** | **kotlin.collections.Map<kotlin.String, kotlin.Boolean>** | | [optional] +**indirectMap** | **kotlin.collections.Map<kotlin.String, kotlin.Boolean>** | | [optional] + + + +## Enum: map_of_enum_string +Name | Value +---- | ----- +mapOfEnumString | UPPER, lower + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..74456741217 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,12 @@ + +# MixedPropertiesAndAdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | [**java.util.UUID**](java.util.UUID.md) | | [optional] +**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**map** | [**kotlin.collections.Map<kotlin.String, Animal>**](Animal.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Name.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Name.md new file mode 100644 index 00000000000..343700533c7 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Name.md @@ -0,0 +1,13 @@ + +# Name + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.Int** | | +**snakeCase** | **kotlin.Int** | | [optional] [readonly] +**property** | **kotlin.String** | | [optional] +**`123number`** | **kotlin.Int** | | [optional] [readonly] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/NullableClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/NullableClass.md new file mode 100644 index 00000000000..9ec43d0b87c --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/NullableClass.md @@ -0,0 +1,21 @@ + +# NullableClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integerProp** | **kotlin.Int** | | [optional] +**numberProp** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] +**booleanProp** | **kotlin.Boolean** | | [optional] +**stringProp** | **kotlin.String** | | [optional] +**dateProp** | [**java.time.LocalDate**](java.time.LocalDate.md) | | [optional] +**datetimeProp** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**arrayNullableProp** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**arrayAndItemsNullableProp** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**arrayItemsNullable** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectNullableProp** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectAndItemsNullableProp** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectItemsNullable** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/NumberOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/NumberOnly.md new file mode 100644 index 00000000000..41e8b82470b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/NumberOnly.md @@ -0,0 +1,10 @@ + +# NumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justNumber** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Order.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Order.md new file mode 100644 index 00000000000..5112f08958d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/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**](#StatusEnum) | Order Status | [optional] +**complete** | **kotlin.Boolean** | | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | placed, approved, delivered + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterComposite.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterComposite.md new file mode 100644 index 00000000000..5296703674d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterComposite.md @@ -0,0 +1,12 @@ + +# OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] +**myString** | **kotlin.String** | | [optional] +**myBoolean** | **kotlin.Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterEnum.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterEnum.md new file mode 100644 index 00000000000..9e7ecb9499a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterEnum.md @@ -0,0 +1,14 @@ + +# OuterEnum + +## Enum + + + * `placed` (value: `"placed"`) + + * `approved` (value: `"approved"`) + + * `delivered` (value: `"delivered"`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterEnumDefaultValue.md new file mode 100644 index 00000000000..821d297a001 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterEnumDefaultValue.md @@ -0,0 +1,14 @@ + +# OuterEnumDefaultValue + +## Enum + + + * `placed` (value: `"placed"`) + + * `approved` (value: `"approved"`) + + * `delivered` (value: `"delivered"`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterEnumInteger.md new file mode 100644 index 00000000000..b40f6e4b7ef --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterEnumInteger.md @@ -0,0 +1,14 @@ + +# OuterEnumInteger + +## Enum + + + * `_0` (value: `0`) + + * `_1` (value: `1`) + + * `_2` (value: `2`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 00000000000..c2fb3ee41d7 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,14 @@ + +# OuterEnumIntegerDefaultValue + +## Enum + + + * `_0` (value: `0`) + + * `_1` (value: `1`) + + * `_2` (value: `2`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Pet.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Pet.md new file mode 100644 index 00000000000..70c340005d1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Pet.md @@ -0,0 +1,22 @@ + +# Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | | +**photoUrls** | **kotlin.Array<kotlin.String>** | | +**id** | **kotlin.Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**tags** | [**kotlin.Array<Tag>**](Tag.md) | | [optional] +**status** | [**inline**](#StatusEnum) | pet status in the store | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | available, pending, sold + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/PetApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/PetApi.md new file mode 100644 index 00000000000..576d2f04ca8 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/PetApi.md @@ -0,0 +1,457 @@ +# 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 +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +try { + apiInstance.addPet(pet) +} catch (e: ClientException) { + println("4xx response calling PetApi#addPet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#addPet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | Pet id to delete +val apiKey : kotlin.String = apiKey_example // kotlin.String | +try { + apiInstance.deletePet(petId, apiKey) +} catch (e: ClientException) { + println("4xx response calling PetApi#deletePet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#deletePet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| Pet id to delete | + **apiKey** | **kotlin.String**| | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **findPetsByStatus** +> kotlin.Array<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val status : kotlin.Array = // kotlin.Array | Status values that need to be considered for filter +try { + val result : kotlin.Array = apiInstance.findPetsByStatus(status) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#findPetsByStatus") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#findPetsByStatus") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + +### Return type + +[**kotlin.Array<Pet>**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **findPetsByTags** +> kotlin.Array<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val tags : kotlin.Array = // kotlin.Array | Tags to filter by +try { + val result : kotlin.Array = apiInstance.findPetsByTags(tags) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#findPetsByTags") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#findPetsByTags") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Tags to filter by | + +### Return type + +[**kotlin.Array<Pet>**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to return +try { + val result : Pet = apiInstance.getPetById(petId) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#getPetById") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#getPetById") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **updatePet** +> updatePet(pet) + +Update an existing pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +try { + apiInstance.updatePet(pet) +} catch (e: ClientException) { + println("4xx response calling PetApi#updatePet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#updatePet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated +val name : kotlin.String = name_example // kotlin.String | Updated name of the pet +val status : kotlin.String = status_example // kotlin.String | Updated status of the pet +try { + apiInstance.updatePetWithForm(petId, name, status) +} catch (e: ClientException) { + println("4xx response calling PetApi#updatePetWithForm") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#updatePetWithForm") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet that needs to be updated | + **name** | **kotlin.String**| Updated name of the pet | [optional] + **status** | **kotlin.String**| Updated status of the pet | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **uploadFile** +> ApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update +val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server +val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload +try { + val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#uploadFile") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#uploadFile") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to update | + **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] + **file** | **java.io.File**| file to upload | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +# **uploadFileWithRequiredFile** +> ApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update +val requiredFile : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload +val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server +try { + val result : ApiResponse = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#uploadFileWithRequiredFile") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#uploadFileWithRequiredFile") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to update | + **requiredFile** | **java.io.File**| file to upload | + **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ReadOnlyFirst.md new file mode 100644 index 00000000000..825f613f090 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ReadOnlyFirst.md @@ -0,0 +1,11 @@ + +# ReadOnlyFirst + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **kotlin.String** | | [optional] [readonly] +**baz** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Return.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Return.md new file mode 100644 index 00000000000..a5437240dc3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Return.md @@ -0,0 +1,10 @@ + +# Return + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**`return`** | **kotlin.Int** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/SpecialModelName.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/SpecialModelName.md new file mode 100644 index 00000000000..282649449d9 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/SpecialModelName.md @@ -0,0 +1,10 @@ + +# SpecialModelname + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **kotlin.Long** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/StoreApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/StoreApi.md new file mode 100644 index 00000000000..55bd8afdbc0 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/StoreApi.md @@ -0,0 +1,196 @@ +# 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 +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted +try { + apiInstance.deleteOrder(orderId) +} catch (e: ClientException) { + println("4xx response calling StoreApi#deleteOrder") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#deleteOrder") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.String**| ID of the order that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **getInventory** +> kotlin.collections.Map<kotlin.String, kotlin.Int> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +try { + val result : kotlin.collections.Map = apiInstance.getInventory() + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#getInventory") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#getInventory") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**kotlin.collections.Map<kotlin.String, kotlin.Int>** + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched +try { + val result : Order = apiInstance.getOrderById(orderId) + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#getOrderById") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#getOrderById") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **placeOrder** +> Order placeOrder(order) + +Place an order for a pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val order : Order = // Order | order placed for purchasing the pet +try { + val result : Order = apiInstance.placeOrder(order) + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#placeOrder") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#placeOrder") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/xml, application/json + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Tag.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Tag.md new file mode 100644 index 00000000000..60ce1bcdbad --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/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/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/User.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/User.md new file mode 100644 index 00000000000..e801729b5ed --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/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/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/UserApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/UserApi.md new file mode 100644 index 00000000000..dbf78e81eb2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/UserApi.md @@ -0,0 +1,376 @@ +# 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 +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : User = // User | Created user object +try { + apiInstance.createUser(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md)| Created user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(user) + +Creates list of users with given input array + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : kotlin.Array = // kotlin.Array | List of user object +try { + apiInstance.createUsersWithArrayInput(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUsersWithArrayInput") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUsersWithArrayInput") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**kotlin.Array<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 + + +# **createUsersWithListInput** +> createUsersWithListInput(user) + +Creates list of users with given input array + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : kotlin.Array = // kotlin.Array | List of user object +try { + apiInstance.createUsersWithListInput(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUsersWithListInput") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUsersWithListInput") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**kotlin.Array<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 + + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The name that needs to be deleted +try { + apiInstance.deleteUser(username) +} catch (e: ClientException) { + println("4xx response calling UserApi#deleteUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#deleteUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The name that needs to be fetched. Use user1 for testing. +try { + val result : User = apiInstance.getUserByName(username) + println(result) +} catch (e: ClientException) { + println("4xx response calling UserApi#getUserByName") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#getUserByName") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **loginUser** +> kotlin.String loginUser(username, password) + +Logs user into the system + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The user name for login +val password : kotlin.String = password_example // kotlin.String | The password for login in clear text +try { + val result : kotlin.String = apiInstance.loginUser(username, password) + println(result) +} catch (e: ClientException) { + println("4xx response calling UserApi#loginUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#loginUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The user name for login | + **password** | **kotlin.String**| The password for login in clear text | + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +try { + apiInstance.logoutUser() +} catch (e: ClientException) { + println("4xx response calling UserApi#logoutUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#logoutUser") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **updateUser** +> updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | name that need to be deleted +val user : User = // User | Updated user object +try { + apiInstance.updateUser(username, user) +} catch (e: ClientException) { + println("4xx response calling UserApi#updateUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#updateUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| name that need to be deleted | + **user** | [**User**](User.md)| Updated user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/settings.gradle b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/settings.gradle new file mode 100644 index 00000000000..06f03c0c413 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/settings.gradle @@ -0,0 +1,2 @@ + +rootProject.name = 'kotlin-petstore-rx-client' \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt new file mode 100644 index 00000000000..8814c97b6b4 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt @@ -0,0 +1,16 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import rx.Observable + +import org.openapitools.client.models.Client + +interface AnotherFakeApi { + @PATCH("/another-fake/dummy") + fun call123testSpecialTags(@Body client: Client): Observable + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt new file mode 100644 index 00000000000..a7cc4c43ea6 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -0,0 +1,16 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import rx.Observable + +import org.openapitools.client.models.InlineResponseDefault + +interface DefaultApi { + @GET("/foo") + fun fooGet(): Observable + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt new file mode 100644 index 00000000000..d9ba172b327 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt @@ -0,0 +1,66 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import rx.Observable + +import org.openapitools.client.models.Client +import org.openapitools.client.models.FileSchemaTestClass +import org.openapitools.client.models.HealthCheckResult +import org.openapitools.client.models.OuterComposite +import org.openapitools.client.models.Pet +import org.openapitools.client.models.User + +interface FakeApi { + @GET("/fake/health") + fun fakeHealthGet(): Observable + + @GET("/fake/http-signature-test") + fun fakeHttpSignatureTest(@Body pet: Pet, @Query("query_1") query1: kotlin.String, @Header("header_1") header1: kotlin.String): Observable + + @POST("/fake/outer/boolean") + fun fakeOuterBooleanSerialize(@Body body: kotlin.Boolean): Observable + + @POST("/fake/outer/composite") + fun fakeOuterCompositeSerialize(@Body outerComposite: OuterComposite): Observable + + @POST("/fake/outer/number") + fun fakeOuterNumberSerialize(@Body body: java.math.BigDecimal): Observable + + @POST("/fake/outer/string") + fun fakeOuterStringSerialize(@Body body: kotlin.String): Observable + + @PUT("/fake/body-with-file-schema") + fun testBodyWithFileSchema(@Body fileSchemaTestClass: FileSchemaTestClass): Observable + + @PUT("/fake/body-with-query-params") + fun testBodyWithQueryParams(@Query("query") query: kotlin.String, @Body user: User): Observable + + @PATCH("/fake") + fun testClientModel(@Body client: Client): Observable + + @FormUrlEncoded + @POST("/fake") + fun testEndpointParameters(@Field("number") number: java.math.BigDecimal, @Field("double") double: kotlin.Double, @Field("pattern_without_delimiter") patternWithoutDelimiter: kotlin.String, @Field("byte") byte: kotlin.ByteArray, @Field("integer") integer: kotlin.Int, @Field("int32") int32: kotlin.Int, @Field("int64") int64: kotlin.Long, @Field("float") float: kotlin.Float, @Field("string") string: kotlin.String, @Field("binary") binary: MultipartBody.Part, @Field("date") date: java.time.LocalDate, @Field("dateTime") dateTime: java.time.OffsetDateTime, @Field("password") password: kotlin.String, @Field("callback") paramCallback: kotlin.String): Observable + + @FormUrlEncoded + @GET("/fake") + fun testEnumParameters(@Header("enum_header_string_array") enumHeaderStringArray: kotlin.Array, @Header("enum_header_string") enumHeaderString: kotlin.String, @Query("enum_query_string_array") enumQueryStringArray: kotlin.Array, @Query("enum_query_string") enumQueryString: kotlin.String, @Query("enum_query_integer") enumQueryInteger: kotlin.Int, @Query("enum_query_double") enumQueryDouble: kotlin.Double, @Field("enum_form_string_array") enumFormStringArray: kotlin.Array, @Field("enum_form_string") enumFormString: kotlin.String): Observable + + @DELETE("/fake") + fun testGroupParameters(@Query("required_string_group") requiredStringGroup: kotlin.Int, @Header("required_boolean_group") requiredBooleanGroup: kotlin.Boolean, @Query("required_int64_group") requiredInt64Group: kotlin.Long, @Query("string_group") stringGroup: kotlin.Int, @Header("boolean_group") booleanGroup: kotlin.Boolean, @Query("int64_group") int64Group: kotlin.Long): Observable + + @POST("/fake/inline-additionalProperties") + fun testInlineAdditionalProperties(@Body requestBody: kotlin.collections.Map): Observable + + @FormUrlEncoded + @GET("/fake/jsonFormData") + fun testJsonFormData(@Field("param") param: kotlin.String, @Field("param2") param2: kotlin.String): Observable + + @PUT("/fake/test-query-paramters") + fun testQueryParameterCollectionFormat(@Query("pipe") pipe: kotlin.Array, @Query("ioutil") ioutil: CSVParams, @Query("http") http: SPACEParams, @Query("url") url: CSVParams, @Query("context") context: kotlin.Array): Observable + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt new file mode 100644 index 00000000000..a186587a372 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt @@ -0,0 +1,16 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import rx.Observable + +import org.openapitools.client.models.Client + +interface FakeClassnameTags123Api { + @PATCH("/fake_classname_test") + fun testClassname(@Body client: Client): Observable + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/PetApi.kt new file mode 100644 index 00000000000..3c778776b58 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -0,0 +1,45 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import rx.Observable + +import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.Pet + +interface PetApi { + @POST("/pet") + fun addPet(@Body pet: Pet): Observable + + @DELETE("/pet/{petId}") + fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String): Observable + + @GET("/pet/findByStatus") + fun findPetsByStatus(@Query("status") status: CSVParams): Observable> + + @Deprecated("This api was deprecated") + @GET("/pet/findByTags") + fun findPetsByTags(@Query("tags") tags: CSVParams): Observable> + + @GET("/pet/{petId}") + fun getPetById(@Path("petId") petId: kotlin.Long): Observable + + @PUT("/pet") + fun updatePet(@Body pet: Pet): Observable + + @FormUrlEncoded + @POST("/pet/{petId}") + fun updatePetWithForm(@Path("petId") petId: kotlin.Long, @Field("name") name: kotlin.String, @Field("status") status: kotlin.String): Observable + + @Multipart + @POST("/pet/{petId}/uploadImage") + fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String, @Part file: MultipartBody.Part): Observable + + @Multipart + @POST("/fake/{petId}/uploadImageWithRequiredFile") + fun uploadFileWithRequiredFile(@Path("petId") petId: kotlin.Long, @Part requiredFile: MultipartBody.Part, @Part("additionalMetadata") additionalMetadata: kotlin.String): Observable + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt new file mode 100644 index 00000000000..1bd8adb28d0 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -0,0 +1,25 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import rx.Observable + +import org.openapitools.client.models.Order + +interface StoreApi { + @DELETE("/store/order/{order_id}") + fun deleteOrder(@Path("order_id") orderId: kotlin.String): Observable + + @GET("/store/inventory") + fun getInventory(): Observable> + + @GET("/store/order/{order_id}") + fun getOrderById(@Path("order_id") orderId: kotlin.Long): Observable + + @POST("/store/order") + fun placeOrder(@Body order: Order): Observable + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/UserApi.kt new file mode 100644 index 00000000000..aca47deab12 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -0,0 +1,37 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import rx.Observable + +import org.openapitools.client.models.User + +interface UserApi { + @POST("/user") + fun createUser(@Body user: User): Observable + + @POST("/user/createWithArray") + fun createUsersWithArrayInput(@Body user: kotlin.Array): Observable + + @POST("/user/createWithList") + fun createUsersWithListInput(@Body user: kotlin.Array): Observable + + @DELETE("/user/{username}") + fun deleteUser(@Path("username") username: kotlin.String): Observable + + @GET("/user/{username}") + fun getUserByName(@Path("username") username: kotlin.String): Observable + + @GET("/user/login") + fun loginUser(@Query("username") username: kotlin.String, @Query("password") password: kotlin.String): Observable + + @GET("/user/logout") + fun logoutUser(): Observable + + @PUT("/user/{username}") + fun updateUser(@Path("username") username: kotlin.String, @Body user: User): Observable + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt new file mode 100644 index 00000000000..5af331818cb --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -0,0 +1,42 @@ +package org.openapitools.client.infrastructure + +import okhttp3.OkHttpClient +import retrofit2.Retrofit +import retrofit2.converter.scalars.ScalarsConverterFactory +import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory +import retrofit2.converter.gson.GsonConverterFactory + +class ApiClient( + private var baseUrl: String = defaultBasePath, + private var okHttpClient: OkHttpClient +) { + companion object { + @JvmStatic + val defaultBasePath: String by lazy { + System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") + } + } + + init { + normalizeBaseUrl() + } + + val retrofitBuilder: Retrofit.Builder by lazy { + + Retrofit.Builder() + .baseUrl(baseUrl) + .addConverterFactory(ScalarsConverterFactory.create()) + .addConverterFactory(GsonConverterFactory.create(Serializer.gson)) + .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) + } + + fun createService(serviceClass: Class): S { + return retrofitBuilder.client(okHttpClient).build().create(serviceClass) + } + + private fun normalizeBaseUrl() { + if (!baseUrl.endsWith("/")) { + baseUrl += "/" + } + } +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt new file mode 100644 index 00000000000..6120b081929 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -0,0 +1,33 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException + +class ByteArrayAdapter : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: ByteArray?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(String(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): ByteArray? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return out.nextString().toByteArray() + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt new file mode 100644 index 00000000000..001e99325d2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/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/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt new file mode 100644 index 00000000000..c5d330ac075 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt @@ -0,0 +1,37 @@ +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/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt new file mode 100644 index 00000000000..30ef6697183 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.LocalDate +import java.time.format.DateTimeFormatter + +class LocalDateAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: LocalDate?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): LocalDate? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return LocalDate.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt new file mode 100644 index 00000000000..3ad781c66ca --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter + +class LocalDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: LocalDateTime?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): LocalDateTime? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return LocalDateTime.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt new file mode 100644 index 00000000000..e615135c9cc --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.OffsetDateTime +import java.time.format.DateTimeFormatter + +class OffsetDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: OffsetDateTime?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): OffsetDateTime? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return OffsetDateTime.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt new file mode 100644 index 00000000000..6465f148553 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -0,0 +1,24 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.Gson +import com.google.gson.GsonBuilder +import java.time.LocalDate +import java.time.LocalDateTime +import java.time.OffsetDateTime +import java.util.UUID +import java.util.Date + +object Serializer { + @JvmStatic + val gsonBuilder: GsonBuilder = GsonBuilder() + .registerTypeAdapter(Date::class.java, DateAdapter()) + .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) + .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) + .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) + .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) + + @JvmStatic + val gson: Gson by lazy { + gsonBuilder.create() + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt new file mode 100644 index 00000000000..6d216739f0b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param mapProperty + * @param mapOfMapProperty + */ + +data class AdditionalPropertiesClass ( + @SerializedName("map_property") + val mapProperty: kotlin.collections.Map? = null, + @SerializedName("map_of_map_property") + val mapOfMapProperty: kotlin.collections.Map>? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Animal.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Animal.kt new file mode 100644 index 00000000000..86992f00d6a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Animal.kt @@ -0,0 +1,33 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param className + * @param color + */ + +interface Animal : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + @get:SerializedName("className") + val className: kotlin.String + @get:SerializedName("color") + val color: kotlin.String? +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt new file mode 100644 index 00000000000..15ea8f6ce57 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -0,0 +1,37 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @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/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt new file mode 100644 index 00000000000..02723cb9dcd --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param arrayArrayNumber + */ + +data class ArrayOfArrayOfNumberOnly ( + @SerializedName("ArrayArrayNumber") + val arrayArrayNumber: kotlin.Array>? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt new file mode 100644 index 00000000000..afde31b7ff4 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param arrayNumber + */ + +data class ArrayOfNumberOnly ( + @SerializedName("ArrayNumber") + val arrayNumber: kotlin.Array? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt new file mode 100644 index 00000000000..d9946e24ba4 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt @@ -0,0 +1,38 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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.ReadOnlyFirst + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param arrayOfString + * @param arrayArrayOfInteger + * @param arrayArrayOfModel + */ + +data class ArrayTest ( + @SerializedName("array_of_string") + val arrayOfString: kotlin.Array? = null, + @SerializedName("array_array_of_integer") + val arrayArrayOfInteger: kotlin.Array>? = null, + @SerializedName("array_array_of_model") + val arrayArrayOfModel: kotlin.Array>? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Capitalization.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Capitalization.kt new file mode 100644 index 00000000000..a7c7d3c9a76 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Capitalization.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param smallCamel + * @param capitalCamel + * @param smallSnake + * @param capitalSnake + * @param scAETHFlowPoints + * @param ATT_NAME Name of the pet + */ + +data class Capitalization ( + @SerializedName("smallCamel") + val smallCamel: kotlin.String? = null, + @SerializedName("CapitalCamel") + val capitalCamel: kotlin.String? = null, + @SerializedName("small_Snake") + val smallSnake: kotlin.String? = null, + @SerializedName("Capital_Snake") + val capitalSnake: kotlin.String? = null, + @SerializedName("SCA_ETH_Flow_Points") + val scAETHFlowPoints: kotlin.String? = null, + /* Name of the pet */ + @SerializedName("ATT_NAME") + val ATT_NAME: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Cat.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Cat.kt new file mode 100644 index 00000000000..3c0b6063ce1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Cat.kt @@ -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.models + +import org.openapitools.client.models.Animal +import org.openapitools.client.models.CatAllOf + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param className + * @param color + * @param declawed + */ + +data class Cat ( + @SerializedName("className") + override val className: kotlin.String, + @SerializedName("color") + override val color: kotlin.String? = null, + @SerializedName("declawed") + val declawed: kotlin.Boolean? = null +) : Animal, Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt new file mode 100644 index 00000000000..7b42c1e2f51 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param declawed + */ + +data class CatAllOf ( + @SerializedName("declawed") + val declawed: kotlin.Boolean? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Category.kt new file mode 100644 index 00000000000..eddd17dc023 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param name + * @param id + */ + +data class Category ( + @SerializedName("name") + val name: kotlin.String, + @SerializedName("id") + val id: kotlin.Long? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ClassModel.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ClassModel.kt new file mode 100644 index 00000000000..d4ca6d61241 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ClassModel.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * Model for testing model with \"_class\" property + * @param propertyClass + */ + +data class ClassModel ( + @SerializedName("_class") + val propertyClass: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Client.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Client.kt new file mode 100644 index 00000000000..2823f40b88b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Client.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param client + */ + +data class Client ( + @SerializedName("client") + val client: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Dog.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Dog.kt new file mode 100644 index 00000000000..fbc06cf1dd6 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Dog.kt @@ -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.models + +import org.openapitools.client.models.Animal +import org.openapitools.client.models.DogAllOf + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param className + * @param color + * @param breed + */ + +data class Dog ( + @SerializedName("className") + override val className: kotlin.String, + @SerializedName("color") + override val color: kotlin.String? = null, + @SerializedName("breed") + val breed: kotlin.String? = null +) : Animal, Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt new file mode 100644 index 00000000000..c422756a65f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param breed + */ + +data class DogAllOf ( + @SerializedName("breed") + val breed: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt new file mode 100644 index 00000000000..8ffe63f244b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param justSymbol + * @param arrayEnum + */ + +data class EnumArrays ( + @SerializedName("just_symbol") + val justSymbol: EnumArrays.JustSymbol? = null, + @SerializedName("array_enum") + val arrayEnum: kotlin.Array? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * + * Values: greaterThanEqual,dollar + */ + + enum class JustSymbol(val value: kotlin.String){ + @SerializedName(value = ">=") greaterThanEqual(">="), + @SerializedName(value = "$") dollar("$"); + } + /** + * + * Values: fish,crab + */ + + enum class ArrayEnum(val value: kotlin.String){ + @SerializedName(value = "fish") fish("fish"), + @SerializedName(value = "crab") crab("crab"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/EnumClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/EnumClass.kt new file mode 100644 index 00000000000..2eccf5d72fa --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/EnumClass.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 + +/** +* +* Values: abc,minusEfg,leftParenthesisXyzRightParenthesis +*/ + +enum class EnumClass(val value: kotlin.String){ + + + @SerializedName(value = "_abc") + abc("_abc"), + + + @SerializedName(value = "-efg") + minusEfg("-efg"), + + + @SerializedName(value = "(xyz)") + leftParenthesisXyzRightParenthesis("(xyz)"); + + + + /** + 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/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/EnumTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/EnumTest.kt new file mode 100644 index 00000000000..a939ed3f41a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/EnumTest.kt @@ -0,0 +1,94 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.OuterEnum +import org.openapitools.client.models.OuterEnumDefaultValue +import org.openapitools.client.models.OuterEnumInteger +import org.openapitools.client.models.OuterEnumIntegerDefaultValue + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param enumStringRequired + * @param enumString + * @param enumInteger + * @param enumNumber + * @param outerEnum + * @param outerEnumInteger + * @param outerEnumDefaultValue + * @param outerEnumIntegerDefaultValue + */ + +data class EnumTest ( + @SerializedName("enum_string_required") + val enumStringRequired: EnumTest.EnumStringRequired, + @SerializedName("enum_string") + val enumString: EnumTest.EnumString? = null, + @SerializedName("enum_integer") + val enumInteger: EnumTest.EnumInteger? = null, + @SerializedName("enum_number") + val enumNumber: EnumTest.EnumNumber? = null, + @SerializedName("outerEnum") + val outerEnum: OuterEnum? = null, + @SerializedName("outerEnumInteger") + val outerEnumInteger: OuterEnumInteger? = null, + @SerializedName("outerEnumDefaultValue") + val outerEnumDefaultValue: OuterEnumDefaultValue? = null, + @SerializedName("outerEnumIntegerDefaultValue") + val outerEnumIntegerDefaultValue: OuterEnumIntegerDefaultValue? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * + * Values: uPPER,lower,eMPTY + */ + + enum class EnumStringRequired(val value: kotlin.String){ + @SerializedName(value = "UPPER") uPPER("UPPER"), + @SerializedName(value = "lower") lower("lower"), + @SerializedName(value = "") eMPTY(""); + } + /** + * + * Values: uPPER,lower,eMPTY + */ + + enum class EnumString(val value: kotlin.String){ + @SerializedName(value = "UPPER") uPPER("UPPER"), + @SerializedName(value = "lower") lower("lower"), + @SerializedName(value = "") eMPTY(""); + } + /** + * + * Values: _1,minus1 + */ + + enum class EnumInteger(val value: kotlin.Int){ + @SerializedName(value = "1") _1(1), + @SerializedName(value = "-1") minus1(-1); + } + /** + * + * Values: _1period1,minus1Period2 + */ + + enum class EnumNumber(val value: kotlin.Double){ + @SerializedName(value = "1.1") _1period1(1.1), + @SerializedName(value = "-1.2") minus1Period2(-1.2); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt new file mode 100644 index 00000000000..8ccd536e097 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param file + * @param files + */ + +data class FileSchemaTestClass ( + @SerializedName("file") + val file: java.io.File? = null, + @SerializedName("files") + val files: kotlin.Array? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Foo.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Foo.kt new file mode 100644 index 00000000000..eac43b98525 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Foo.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param bar + */ + +data class Foo ( + @SerializedName("bar") + val bar: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/FormatTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/FormatTest.kt new file mode 100644 index 00000000000..f8f4fd03128 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/FormatTest.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param number + * @param byte + * @param date + * @param password + * @param integer + * @param int32 + * @param int64 + * @param float + * @param double + * @param string + * @param binary + * @param dateTime + * @param uuid + * @param patternWithDigits A string that is a 10 digit number. Can have leading zeros. + * @param patternWithDigitsAndDelimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + */ + +data class FormatTest ( + @SerializedName("number") + val number: java.math.BigDecimal, + @SerializedName("byte") + val byte: kotlin.ByteArray, + @SerializedName("date") + val date: java.time.LocalDate, + @SerializedName("password") + val password: kotlin.String, + @SerializedName("integer") + val integer: kotlin.Int? = null, + @SerializedName("int32") + val int32: kotlin.Int? = null, + @SerializedName("int64") + val int64: kotlin.Long? = null, + @SerializedName("float") + val float: kotlin.Float? = null, + @SerializedName("double") + val double: kotlin.Double? = null, + @SerializedName("string") + val string: kotlin.String? = null, + @SerializedName("binary") + val binary: java.io.File? = null, + @SerializedName("dateTime") + val dateTime: java.time.OffsetDateTime? = null, + @SerializedName("uuid") + val uuid: java.util.UUID? = null, + /* A string that is a 10 digit number. Can have leading zeros. */ + @SerializedName("pattern_with_digits") + val patternWithDigits: kotlin.String? = null, + /* A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. */ + @SerializedName("pattern_with_digits_and_delimiter") + val patternWithDigitsAndDelimiter: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt new file mode 100644 index 00000000000..e70f3360998 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param bar + * @param foo + */ + +data class HasOnlyReadOnly ( + @SerializedName("bar") + val bar: kotlin.String? = null, + @SerializedName("foo") + val foo: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt new file mode 100644 index 00000000000..5ea4977b7cb --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + * @param nullableMessage + */ + +data class HealthCheckResult ( + @SerializedName("NullableMessage") + val nullableMessage: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject.kt new file mode 100644 index 00000000000..e513221c62b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param name Updated name of the pet + * @param status Updated status of the pet + */ + +data class InlineObject ( + /* Updated name of the pet */ + @SerializedName("name") + val name: kotlin.String? = null, + /* Updated status of the pet */ + @SerializedName("status") + val status: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt new file mode 100644 index 00000000000..183929c471f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + */ + +data class InlineObject1 ( + /* Additional data to pass to server */ + @SerializedName("additionalMetadata") + val additionalMetadata: kotlin.String? = null, + /* file to upload */ + @SerializedName("file") + val file: java.io.File? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt new file mode 100644 index 00000000000..29c4d228fd8 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt @@ -0,0 +1,55 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param enumFormStringArray Form parameter enum test (string array) + * @param enumFormString Form parameter enum test (string) + */ + +data class InlineObject2 ( + /* Form parameter enum test (string array) */ + @SerializedName("enum_form_string_array") + val enumFormStringArray: kotlin.Array? = null, + /* Form parameter enum test (string) */ + @SerializedName("enum_form_string") + val enumFormString: InlineObject2.EnumFormString? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * Form parameter enum test (string array) + * Values: greaterThan,dollar + */ + + enum class EnumFormStringArray(val value: kotlin.String){ + @SerializedName(value = ">") greaterThan(">"), + @SerializedName(value = "$") dollar("$"); + } + /** + * Form parameter enum test (string) + * Values: abc,minusEfg,leftParenthesisXyzRightParenthesis + */ + + enum class EnumFormString(val value: kotlin.String){ + @SerializedName(value = "_abc") abc("_abc"), + @SerializedName(value = "-efg") minusEfg("-efg"), + @SerializedName(value = "(xyz)") leftParenthesisXyzRightParenthesis("(xyz)"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt new file mode 100644 index 00000000000..a5734ebed46 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param number None + * @param double None + * @param patternWithoutDelimiter None + * @param byte None + * @param integer None + * @param int32 None + * @param int64 None + * @param float None + * @param string None + * @param binary None + * @param date None + * @param dateTime None + * @param password None + * @param callback None + */ + +data class InlineObject3 ( + /* None */ + @SerializedName("number") + val number: java.math.BigDecimal, + /* None */ + @SerializedName("double") + val double: kotlin.Double, + /* None */ + @SerializedName("pattern_without_delimiter") + val patternWithoutDelimiter: kotlin.String, + /* None */ + @SerializedName("byte") + val byte: kotlin.ByteArray, + /* None */ + @SerializedName("integer") + val integer: kotlin.Int? = null, + /* None */ + @SerializedName("int32") + val int32: kotlin.Int? = null, + /* None */ + @SerializedName("int64") + val int64: kotlin.Long? = null, + /* None */ + @SerializedName("float") + val float: kotlin.Float? = null, + /* None */ + @SerializedName("string") + val string: kotlin.String? = null, + /* None */ + @SerializedName("binary") + val binary: java.io.File? = null, + /* None */ + @SerializedName("date") + val date: java.time.LocalDate? = null, + /* None */ + @SerializedName("dateTime") + val dateTime: java.time.OffsetDateTime? = null, + /* None */ + @SerializedName("password") + val password: kotlin.String? = null, + /* None */ + @SerializedName("callback") + val callback: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt new file mode 100644 index 00000000000..488f57faff3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param param field1 + * @param param2 field2 + */ + +data class InlineObject4 ( + /* field1 */ + @SerializedName("param") + val param: kotlin.String, + /* field2 */ + @SerializedName("param2") + val param2: kotlin.String +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt new file mode 100644 index 00000000000..1bd7d0c64b8 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param requiredFile file to upload + * @param additionalMetadata Additional data to pass to server + */ + +data class InlineObject5 ( + /* file to upload */ + @SerializedName("requiredFile") + val requiredFile: java.io.File, + /* Additional data to pass to server */ + @SerializedName("additionalMetadata") + val additionalMetadata: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt new file mode 100644 index 00000000000..0252304ee84 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt @@ -0,0 +1,32 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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.Foo + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param string + */ + +data class InlineResponseDefault ( + @SerializedName("string") + val string: Foo? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/List.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/List.kt new file mode 100644 index 00000000000..b7c9f9b029b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/List.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param `123minusList` + */ + +data class List ( + @SerializedName("123-list") + val `123minusList`: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/MapTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/MapTest.kt new file mode 100644 index 00000000000..768f0a76603 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/MapTest.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param mapMapOfString + * @param mapOfEnumString + * @param directMap + * @param indirectMap + */ + +data class MapTest ( + @SerializedName("map_map_of_string") + val mapMapOfString: kotlin.collections.Map>? = null, + @SerializedName("map_of_enum_string") + val mapOfEnumString: MapTest.MapOfEnumString? = null, + @SerializedName("direct_map") + val directMap: kotlin.collections.Map? = null, + @SerializedName("indirect_map") + val indirectMap: kotlin.collections.Map? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * + * Values: uPPER,lower + */ + + enum class MapOfEnumString(val value: kotlin.String){ + @SerializedName(value = "UPPER") uPPER("UPPER"), + @SerializedName(value = "lower") lower("lower"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt new file mode 100644 index 00000000000..ec5c3ba8ead --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt @@ -0,0 +1,38 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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.Animal + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param uuid + * @param dateTime + * @param map + */ + +data class MixedPropertiesAndAdditionalPropertiesClass ( + @SerializedName("uuid") + val uuid: java.util.UUID? = null, + @SerializedName("dateTime") + val dateTime: java.time.OffsetDateTime? = null, + @SerializedName("map") + val map: kotlin.collections.Map? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Model200Response.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Model200Response.kt new file mode 100644 index 00000000000..b9506ce766f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Model200Response.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * Model for testing model name starting with number + * @param name + * @param propertyClass + */ + +data class Model200Response ( + @SerializedName("name") + val name: kotlin.Int? = null, + @SerializedName("class") + val propertyClass: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Name.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Name.kt new file mode 100644 index 00000000000..a26df5946ca --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Name.kt @@ -0,0 +1,40 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * Model for testing model name same as property name + * @param name + * @param snakeCase + * @param property + * @param `123number` + */ + +data class Name ( + @SerializedName("name") + val name: kotlin.Int, + @SerializedName("snake_case") + val snakeCase: kotlin.Int? = null, + @SerializedName("property") + val property: kotlin.String? = null, + @SerializedName("123Number") + val `123number`: kotlin.Int? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/NullableClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/NullableClass.kt new file mode 100644 index 00000000000..44ef32f2637 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/NullableClass.kt @@ -0,0 +1,64 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param integerProp + * @param numberProp + * @param booleanProp + * @param stringProp + * @param dateProp + * @param datetimeProp + * @param arrayNullableProp + * @param arrayAndItemsNullableProp + * @param arrayItemsNullable + * @param objectNullableProp + * @param objectAndItemsNullableProp + * @param objectItemsNullable + */ + +data class NullableClass ( + @SerializedName("integer_prop") + val integerProp: kotlin.Int? = null, + @SerializedName("number_prop") + val numberProp: java.math.BigDecimal? = null, + @SerializedName("boolean_prop") + val booleanProp: kotlin.Boolean? = null, + @SerializedName("string_prop") + val stringProp: kotlin.String? = null, + @SerializedName("date_prop") + val dateProp: java.time.LocalDate? = null, + @SerializedName("datetime_prop") + val datetimeProp: java.time.OffsetDateTime? = null, + @SerializedName("array_nullable_prop") + val arrayNullableProp: kotlin.Array? = null, + @SerializedName("array_and_items_nullable_prop") + val arrayAndItemsNullableProp: kotlin.Array? = null, + @SerializedName("array_items_nullable") + val arrayItemsNullable: kotlin.Array? = null, + @SerializedName("object_nullable_prop") + val objectNullableProp: kotlin.collections.Map? = null, + @SerializedName("object_and_items_nullable_prop") + val objectAndItemsNullableProp: kotlin.collections.Map? = null, + @SerializedName("object_items_nullable") + val objectItemsNullable: kotlin.collections.Map? = null +) : kotlin.collections.HashMap(), Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt new file mode 100644 index 00000000000..ca273d1f3a1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param justNumber + */ + +data class NumberOnly ( + @SerializedName("JustNumber") + val justNumber: java.math.BigDecimal? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Order.kt new file mode 100644 index 00000000000..e691b5ca8fb --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @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/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt new file mode 100644 index 00000000000..8246390507e --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt @@ -0,0 +1,37 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param myNumber + * @param myString + * @param myBoolean + */ + +data class OuterComposite ( + @SerializedName("my_number") + val myNumber: java.math.BigDecimal? = null, + @SerializedName("my_string") + val myString: kotlin.String? = null, + @SerializedName("my_boolean") + val myBoolean: kotlin.Boolean? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt new file mode 100644 index 00000000000..1c2c521eaf5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 + +/** +* +* Values: placed,approved,delivered +*/ + +enum class OuterEnum(val value: kotlin.String){ + + + @SerializedName(value = "placed") + placed("placed"), + + + @SerializedName(value = "approved") + approved("approved"), + + + @SerializedName(value = "delivered") + delivered("delivered"); + + + + /** + 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/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt new file mode 100644 index 00000000000..12c2b0a94aa --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 + +/** +* +* Values: placed,approved,delivered +*/ + +enum class OuterEnumDefaultValue(val value: kotlin.String){ + + + @SerializedName(value = "placed") + placed("placed"), + + + @SerializedName(value = "approved") + approved("approved"), + + + @SerializedName(value = "delivered") + delivered("delivered"); + + + + /** + 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/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt new file mode 100644 index 00000000000..c2ac6a4a936 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 + +/** +* +* Values: _0,_1,_2 +*/ + +enum class OuterEnumInteger(val value: kotlin.Int){ + + + @SerializedName(value = "0") + _0(0), + + + @SerializedName(value = "1") + _1(1), + + + @SerializedName(value = "2") + _2(2); + + + + /** + 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.toString() + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt new file mode 100644 index 00000000000..3066cfbae73 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 + +/** +* +* Values: _0,_1,_2 +*/ + +enum class OuterEnumIntegerDefaultValue(val value: kotlin.Int){ + + + @SerializedName(value = "0") + _0(0), + + + @SerializedName(value = "1") + _1(1), + + + @SerializedName(value = "2") + _2(2); + + + + /** + 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.toString() + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Pet.kt new file mode 100644 index 00000000000..6e0b0b873d1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -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.models + +import org.openapitools.client.models.Category +import org.openapitools.client.models.Tag + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @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.Array, + @SerializedName("id") + val id: kotlin.Long? = null, + @SerializedName("category") + val category: Category? = null, + @SerializedName("tags") + val tags: kotlin.Array? = 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/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt new file mode 100644 index 00000000000..5dff54dc190 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param bar + * @param baz + */ + +data class ReadOnlyFirst ( + @SerializedName("bar") + val bar: kotlin.String? = null, + @SerializedName("baz") + val baz: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Return.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Return.kt new file mode 100644 index 00000000000..ecdce7f408f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Return.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * Model for testing reserved words + * @param `return` + */ + +data class Return ( + @SerializedName("return") + val `return`: kotlin.Int? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt new file mode 100644 index 00000000000..f67aa3c948b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket + */ + +data class SpecialModelname ( + @SerializedName("\$special[property.name]") + val dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket: kotlin.Long? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Tag.kt new file mode 100644 index 00000000000..04ca1914328 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @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/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/User.kt new file mode 100644 index 00000000000..24b8c5d47ac --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/User.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @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/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/.openapi-generator-ignore b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/.openapi-generator/VERSION b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/.openapi-generator/VERSION new file mode 100644 index 00000000000..b5d898602c2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/README.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/README.md new file mode 100644 index 00000000000..b7028d917a2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/README.md @@ -0,0 +1,173 @@ +# org.openapitools.client - Kotlin client library for OpenAPI Petstore + +## Requires + +* Kotlin 1.3.41 +* Gradle 4.9 + +## Build + +First, create the gradle wrapper script: + +``` +gradle wrapper +``` + +Then, run: + +``` +./gradlew check assemble +``` + +This runs all tests and packages the library. + +## Features/Implementation Notes + +* Supports JSON inputs/outputs, File inputs, and Form inputs. +* Supports collection formats for query parameters: csv, tsv, ssv, pipes. +* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions. +* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets. + + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io: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* | [**fakeHttpSignatureTest**](docs/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication +*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 +*FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters | +*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 + + - [org.openapitools.client.models.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [org.openapitools.client.models.Animal](docs/Animal.md) + - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) + - [org.openapitools.client.models.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [org.openapitools.client.models.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [org.openapitools.client.models.ArrayTest](docs/ArrayTest.md) + - [org.openapitools.client.models.Capitalization](docs/Capitalization.md) + - [org.openapitools.client.models.Cat](docs/Cat.md) + - [org.openapitools.client.models.CatAllOf](docs/CatAllOf.md) + - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ClassModel](docs/ClassModel.md) + - [org.openapitools.client.models.Client](docs/Client.md) + - [org.openapitools.client.models.Dog](docs/Dog.md) + - [org.openapitools.client.models.DogAllOf](docs/DogAllOf.md) + - [org.openapitools.client.models.EnumArrays](docs/EnumArrays.md) + - [org.openapitools.client.models.EnumClass](docs/EnumClass.md) + - [org.openapitools.client.models.EnumTest](docs/EnumTest.md) + - [org.openapitools.client.models.FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [org.openapitools.client.models.Foo](docs/Foo.md) + - [org.openapitools.client.models.FormatTest](docs/FormatTest.md) + - [org.openapitools.client.models.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [org.openapitools.client.models.HealthCheckResult](docs/HealthCheckResult.md) + - [org.openapitools.client.models.InlineObject](docs/InlineObject.md) + - [org.openapitools.client.models.InlineObject1](docs/InlineObject1.md) + - [org.openapitools.client.models.InlineObject2](docs/InlineObject2.md) + - [org.openapitools.client.models.InlineObject3](docs/InlineObject3.md) + - [org.openapitools.client.models.InlineObject4](docs/InlineObject4.md) + - [org.openapitools.client.models.InlineObject5](docs/InlineObject5.md) + - [org.openapitools.client.models.InlineResponseDefault](docs/InlineResponseDefault.md) + - [org.openapitools.client.models.List](docs/List.md) + - [org.openapitools.client.models.MapTest](docs/MapTest.md) + - [org.openapitools.client.models.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [org.openapitools.client.models.Model200Response](docs/Model200Response.md) + - [org.openapitools.client.models.Name](docs/Name.md) + - [org.openapitools.client.models.NullableClass](docs/NullableClass.md) + - [org.openapitools.client.models.NumberOnly](docs/NumberOnly.md) + - [org.openapitools.client.models.Order](docs/Order.md) + - [org.openapitools.client.models.OuterComposite](docs/OuterComposite.md) + - [org.openapitools.client.models.OuterEnum](docs/OuterEnum.md) + - [org.openapitools.client.models.OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [org.openapitools.client.models.OuterEnumInteger](docs/OuterEnumInteger.md) + - [org.openapitools.client.models.OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) + - [org.openapitools.client.models.Pet](docs/Pet.md) + - [org.openapitools.client.models.ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [org.openapitools.client.models.Return](docs/Return.md) + - [org.openapitools.client.models.SpecialModelname](docs/SpecialModelname.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 + + +### 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 + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/build.gradle b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/build.gradle new file mode 100644 index 00000000000..34fcb2feb46 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/build.gradle @@ -0,0 +1,41 @@ +group 'org.openapitools' +version '1.0.0' + +wrapper { + gradleVersion = '4.9' + distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" +} + +buildscript { + ext.kotlin_version = '1.3.61' + ext.retrofitVersion = '2.6.2' + ext.rxJava2Version = '2.2.17' + + repositories { + maven { url "https://repo1.maven.org/maven2" } + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +apply plugin: 'kotlin' + +repositories { + maven { url "https://repo1.maven.org/maven2" } +} + +test { + useJUnitPlatform() +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + compile "com.google.code.gson:gson:2.8.6" + compile "io.reactivex.rxjava2:rxjava:$rxJava2Version" + compile "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion" + compile "com.squareup.retrofit2:retrofit:$retrofitVersion" + compile "com.squareup.retrofit2:converter-gson:$retrofitVersion" + compile "com.squareup.retrofit2:converter-scalars:$retrofitVersion" + testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0" +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/200Response.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/200Response.md new file mode 100644 index 00000000000..53c1edacfb8 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/200Response.md @@ -0,0 +1,11 @@ + +# Model200Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.Int** | | [optional] +**propertyClass** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..1025301ce94 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/AdditionalPropertiesClass.md @@ -0,0 +1,11 @@ + +# AdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapProperty** | **kotlin.collections.Map<kotlin.String, kotlin.String>** | | [optional] +**mapOfMapProperty** | **kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Animal.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Animal.md new file mode 100644 index 00000000000..5ce5a4972c8 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Animal.md @@ -0,0 +1,11 @@ + +# Animal + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **kotlin.String** | | +**color** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..55d482238db --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/AnotherFakeApi.md @@ -0,0 +1,56 @@ +# 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 +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = AnotherFakeApi() +val client : Client = // Client | client model +try { + val result : Client = apiInstance.call123testSpecialTags(client) + println(result) +} catch (e: ClientException) { + println("4xx response calling AnotherFakeApi#call123testSpecialTags") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling AnotherFakeApi#call123testSpecialTags") + 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 + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ApiResponse.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ApiResponse.md new file mode 100644 index 00000000000..6b4c6bf2779 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ApiResponse.md @@ -0,0 +1,12 @@ + +# ApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **kotlin.Int** | | [optional] +**type** | **kotlin.String** | | [optional] +**message** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 00000000000..23a47566420 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,10 @@ + +# ArrayOfArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayArrayNumber** | **kotlin.Array<kotlin.Array<java.math.BigDecimal>>** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ArrayOfNumberOnly.md new file mode 100644 index 00000000000..b115a5d54c2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ArrayOfNumberOnly.md @@ -0,0 +1,10 @@ + +# ArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayNumber** | [**kotlin.Array<java.math.BigDecimal>**](java.math.BigDecimal.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ArrayTest.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ArrayTest.md new file mode 100644 index 00000000000..aa0bbbe936c --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ArrayTest.md @@ -0,0 +1,12 @@ + +# ArrayTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayOfString** | **kotlin.Array<kotlin.String>** | | [optional] +**arrayArrayOfInteger** | **kotlin.Array<kotlin.Array<kotlin.Long>>** | | [optional] +**arrayArrayOfModel** | **kotlin.Array<kotlin.Array<ReadOnlyFirst>>** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Capitalization.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Capitalization.md new file mode 100644 index 00000000000..9d44a82fb7f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Capitalization.md @@ -0,0 +1,15 @@ + +# Capitalization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**smallCamel** | **kotlin.String** | | [optional] +**capitalCamel** | **kotlin.String** | | [optional] +**smallSnake** | **kotlin.String** | | [optional] +**capitalSnake** | **kotlin.String** | | [optional] +**scAETHFlowPoints** | **kotlin.String** | | [optional] +**ATT_NAME** | **kotlin.String** | Name of the pet | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Cat.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Cat.md new file mode 100644 index 00000000000..b6da7c47ced --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Cat.md @@ -0,0 +1,10 @@ + +# Cat + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **kotlin.Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/CatAllOf.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/CatAllOf.md new file mode 100644 index 00000000000..fb8883197a1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/CatAllOf.md @@ -0,0 +1,10 @@ + +# CatAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **kotlin.Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Category.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Category.md new file mode 100644 index 00000000000..1f12c3eb158 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Category.md @@ -0,0 +1,11 @@ + +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | | +**id** | **kotlin.Long** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ClassModel.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ClassModel.md new file mode 100644 index 00000000000..50ad61b51a5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ClassModel.md @@ -0,0 +1,10 @@ + +# ClassModel + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**propertyClass** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Client.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Client.md new file mode 100644 index 00000000000..11afbcf0c9f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Client.md @@ -0,0 +1,10 @@ + +# Client + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/DefaultApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/DefaultApi.md new file mode 100644 index 00000000000..784be537594 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/DefaultApi.md @@ -0,0 +1,50 @@ +# 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 +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = DefaultApi() +try { + val result : InlineResponseDefault = apiInstance.fooGet() + println(result) +} catch (e: ClientException) { + println("4xx response calling DefaultApi#fooGet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling DefaultApi#fooGet") + 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 + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Dog.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Dog.md new file mode 100644 index 00000000000..41d9c6ba0d1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Dog.md @@ -0,0 +1,10 @@ + +# Dog + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/DogAllOf.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/DogAllOf.md new file mode 100644 index 00000000000..6b14d5e9147 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/DogAllOf.md @@ -0,0 +1,10 @@ + +# DogAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/EnumArrays.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/EnumArrays.md new file mode 100644 index 00000000000..719084e5f94 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/EnumArrays.md @@ -0,0 +1,25 @@ + +# EnumArrays + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justSymbol** | [**inline**](#JustSymbolEnum) | | [optional] +**arrayEnum** | [**inline**](#kotlin.Array<ArrayEnumEnum>) | | [optional] + + + +## Enum: just_symbol +Name | Value +---- | ----- +justSymbol | >=, $ + + + +## Enum: array_enum +Name | Value +---- | ----- +arrayEnum | fish, crab + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/EnumClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/EnumClass.md new file mode 100644 index 00000000000..5ddb262871f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/EnumClass.md @@ -0,0 +1,14 @@ + +# EnumClass + +## Enum + + + * `abc` (value: `"_abc"`) + + * `minusEfg` (value: `"-efg"`) + + * `leftParenthesisXyzRightParenthesis` (value: `"(xyz)"`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/EnumTest.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/EnumTest.md new file mode 100644 index 00000000000..f0370049eb3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/EnumTest.md @@ -0,0 +1,45 @@ + +# EnumTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumStringRequired** | [**inline**](#EnumStringRequiredEnum) | | +**enumString** | [**inline**](#EnumStringEnum) | | [optional] +**enumInteger** | [**inline**](#EnumIntegerEnum) | | [optional] +**enumNumber** | [**inline**](#EnumNumberEnum) | | [optional] +**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] +**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] + + + +## Enum: enum_string_required +Name | Value +---- | ----- +enumStringRequired | UPPER, lower, + + + +## Enum: enum_string +Name | Value +---- | ----- +enumString | UPPER, lower, + + + +## Enum: enum_integer +Name | Value +---- | ----- +enumInteger | 1, -1 + + + +## Enum: enum_number +Name | Value +---- | ----- +enumNumber | 1.1, -1.2 + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FakeApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FakeApi.md new file mode 100644 index 00000000000..fb663183f92 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FakeApi.md @@ -0,0 +1,776 @@ +# 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 +[**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 | +[**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-paramters | + + + +# **fakeHealthGet** +> HealthCheckResult fakeHealthGet() + +Health check endpoint + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +try { + val result : HealthCheckResult = apiInstance.fakeHealthGet() + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeHealthGet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeHealthGet") + 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 + + +# **fakeHttpSignatureTest** +> fakeHttpSignatureTest(pet, query1, header1) + +test http signature authentication + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +val query1 : kotlin.String = query1_example // kotlin.String | query parameter +val header1 : kotlin.String = header1_example // kotlin.String | header parameter +try { + apiInstance.fakeHttpSignatureTest(pet, query1, header1) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeHttpSignatureTest") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeHttpSignatureTest") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **query1** | **kotlin.String**| query parameter | [optional] + **header1** | **kotlin.String**| header parameter | [optional] + +### Return type + +null (empty response body) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +# **fakeOuterBooleanSerialize** +> kotlin.Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val body : kotlin.Boolean = true // kotlin.Boolean | Input boolean as post body +try { + val result : kotlin.Boolean = apiInstance.fakeOuterBooleanSerialize(body) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterBooleanSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterBooleanSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **kotlin.Boolean**| Input boolean as post body | [optional] + +### Return type + +**kotlin.Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(outerComposite) + + + +Test serialization of object with outer number type + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val outerComposite : OuterComposite = // OuterComposite | Input composite as post body +try { + val result : OuterComposite = apiInstance.fakeOuterCompositeSerialize(outerComposite) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterCompositeSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterCompositeSerialize") + 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**: */* + + +# **fakeOuterNumberSerialize** +> java.math.BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val body : java.math.BigDecimal = 8.14 // java.math.BigDecimal | Input number as post body +try { + val result : java.math.BigDecimal = apiInstance.fakeOuterNumberSerialize(body) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterNumberSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterNumberSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **java.math.BigDecimal**| Input number as post body | [optional] + +### Return type + +[**java.math.BigDecimal**](java.math.BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +# **fakeOuterStringSerialize** +> kotlin.String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val body : kotlin.String = body_example // kotlin.String | Input string as post body +try { + val result : kotlin.String = apiInstance.fakeOuterStringSerialize(body) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterStringSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterStringSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **kotlin.String**| Input string as post body | [optional] + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +# **testBodyWithFileSchema** +> testBodyWithFileSchema(fileSchemaTestClass) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val fileSchemaTestClass : FileSchemaTestClass = // FileSchemaTestClass | +try { + apiInstance.testBodyWithFileSchema(fileSchemaTestClass) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testBodyWithFileSchema") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testBodyWithFileSchema") + 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 + + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val query : kotlin.String = query_example // kotlin.String | +val user : User = // User | +try { + apiInstance.testBodyWithQueryParams(query, user) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testBodyWithQueryParams") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testBodyWithQueryParams") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **kotlin.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 + + +# **testClientModel** +> Client testClientModel(client) + +To test \"client\" model + +To test \"client\" model + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val client : Client = // Client | client model +try { + val result : Client = apiInstance.testClientModel(client) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testClientModel") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testClientModel") + 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 + + +# **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 +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val number : java.math.BigDecimal = 8.14 // java.math.BigDecimal | None +val double : kotlin.Double = 1.2 // kotlin.Double | None +val patternWithoutDelimiter : kotlin.String = patternWithoutDelimiter_example // kotlin.String | None +val byte : kotlin.ByteArray = BYTE_ARRAY_DATA_HERE // kotlin.ByteArray | None +val integer : kotlin.Int = 56 // kotlin.Int | None +val int32 : kotlin.Int = 56 // kotlin.Int | None +val int64 : kotlin.Long = 789 // kotlin.Long | None +val float : kotlin.Float = 3.4 // kotlin.Float | None +val string : kotlin.String = string_example // kotlin.String | None +val binary : java.io.File = BINARY_DATA_HERE // java.io.File | None +val date : java.time.LocalDate = 2013-10-20 // java.time.LocalDate | None +val dateTime : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | None +val password : kotlin.String = password_example // kotlin.String | None +val paramCallback : kotlin.String = paramCallback_example // kotlin.String | None +try { + apiInstance.testEndpointParameters(number, double, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, paramCallback) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testEndpointParameters") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testEndpointParameters") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **java.math.BigDecimal**| None | + **double** | **kotlin.Double**| None | + **patternWithoutDelimiter** | **kotlin.String**| None | + **byte** | **kotlin.ByteArray**| None | + **integer** | **kotlin.Int**| None | [optional] + **int32** | **kotlin.Int**| None | [optional] + **int64** | **kotlin.Long**| None | [optional] + **float** | **kotlin.Float**| None | [optional] + **string** | **kotlin.String**| None | [optional] + **binary** | **java.io.File**| None | [optional] + **date** | **java.time.LocalDate**| None | [optional] + **dateTime** | **java.time.OffsetDateTime**| None | [optional] + **password** | **kotlin.String**| None | [optional] + **paramCallback** | **kotlin.String**| None | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure http_basic_test: + ApiClient.username = "" + ApiClient.password = "" + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **testEnumParameters** +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val enumHeaderStringArray : kotlin.Array = // kotlin.Array | Header parameter enum test (string array) +val enumHeaderString : kotlin.String = enumHeaderString_example // kotlin.String | Header parameter enum test (string) +val enumQueryStringArray : kotlin.Array = // kotlin.Array | Query parameter enum test (string array) +val enumQueryString : kotlin.String = enumQueryString_example // kotlin.String | Query parameter enum test (string) +val enumQueryInteger : kotlin.Int = 56 // kotlin.Int | Query parameter enum test (double) +val enumQueryDouble : kotlin.Double = 1.2 // kotlin.Double | Query parameter enum test (double) +val enumFormStringArray : kotlin.Array = enumFormStringArray_example // kotlin.Array | Form parameter enum test (string array) +val enumFormString : kotlin.String = enumFormString_example // kotlin.String | Form parameter enum test (string) +try { + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testEnumParameters") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testEnumParameters") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumHeaderStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] + **enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to '-efg'] [enum: _abc, -efg, (xyz)] + **enumQueryStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] + **enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to '-efg'] [enum: _abc, -efg, (xyz)] + **enumQueryInteger** | **kotlin.Int**| Query parameter enum test (double) | [optional] [enum: 1, -2] + **enumQueryDouble** | **kotlin.Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to '$'] [enum: >, $] + **enumFormString** | **kotlin.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 + + +# **testGroupParameters** +> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val requiredStringGroup : kotlin.Int = 56 // kotlin.Int | Required String in group parameters +val requiredBooleanGroup : kotlin.Boolean = true // kotlin.Boolean | Required Boolean in group parameters +val requiredInt64Group : kotlin.Long = 789 // kotlin.Long | Required Integer in group parameters +val stringGroup : kotlin.Int = 56 // kotlin.Int | String in group parameters +val booleanGroup : kotlin.Boolean = true // kotlin.Boolean | Boolean in group parameters +val int64Group : kotlin.Long = 789 // kotlin.Long | Integer in group parameters +try { + apiInstance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testGroupParameters") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testGroupParameters") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requiredStringGroup** | **kotlin.Int**| Required String in group parameters | + **requiredBooleanGroup** | **kotlin.Boolean**| Required Boolean in group parameters | + **requiredInt64Group** | **kotlin.Long**| Required Integer in group parameters | + **stringGroup** | **kotlin.Int**| String in group parameters | [optional] + **booleanGroup** | **kotlin.Boolean**| Boolean in group parameters | [optional] + **int64Group** | **kotlin.Long**| Integer in group parameters | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure bearer_test: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **testInlineAdditionalProperties** +> testInlineAdditionalProperties(requestBody) + +test inline additionalProperties + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val requestBody : kotlin.collections.Map = // kotlin.collections.Map | request body +try { + apiInstance.testInlineAdditionalProperties(requestBody) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testInlineAdditionalProperties") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testInlineAdditionalProperties") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**kotlin.collections.Map<kotlin.String, kotlin.String>**](kotlin.String.md)| request body | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **testJsonFormData** +> testJsonFormData(param, param2) + +test json serialization of form data + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val param : kotlin.String = param_example // kotlin.String | field1 +val param2 : kotlin.String = param2_example // kotlin.String | field2 +try { + apiInstance.testJsonFormData(param, param2) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testJsonFormData") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testJsonFormData") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **kotlin.String**| field1 | + **param2** | **kotlin.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 + + +# **testQueryParameterCollectionFormat** +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val pipe : kotlin.Array = // kotlin.Array | +val ioutil : kotlin.Array = // kotlin.Array | +val http : kotlin.Array = // kotlin.Array | +val url : kotlin.Array = // kotlin.Array | +val context : kotlin.Array = // kotlin.Array | +try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testQueryParameterCollectionFormat") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testQueryParameterCollectionFormat") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **ioutil** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **http** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **url** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **context** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..962dfd4d2dc --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/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** +> Client testClassname(client) + +To test class name in snake case + +To test class name in snake case + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeClassnameTags123Api() +val client : Client = // Client | client model +try { + val result : Client = apiInstance.testClassname(client) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeClassnameTags123Api#testClassname") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeClassnameTags123Api#testClassname") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + + +Configure api_key_query: + ApiClient.apiKey["api_key_query"] = "" + ApiClient.apiKeyPrefix["api_key_query"] = "" + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FileSchemaTestClass.md new file mode 100644 index 00000000000..089e61862c2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FileSchemaTestClass.md @@ -0,0 +1,11 @@ + +# FileSchemaTestClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**java.io.File**](java.io.File.md) | | [optional] +**files** | [**kotlin.Array<java.io.File>**](java.io.File.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Foo.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Foo.md new file mode 100644 index 00000000000..e3e9918872b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Foo.md @@ -0,0 +1,10 @@ + +# Foo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FormatTest.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FormatTest.md new file mode 100644 index 00000000000..0357923c97a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FormatTest.md @@ -0,0 +1,24 @@ + +# FormatTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | +**byte** | **kotlin.ByteArray** | | +**date** | [**java.time.LocalDate**](java.time.LocalDate.md) | | +**password** | **kotlin.String** | | +**integer** | **kotlin.Int** | | [optional] +**int32** | **kotlin.Int** | | [optional] +**int64** | **kotlin.Long** | | [optional] +**float** | **kotlin.Float** | | [optional] +**double** | **kotlin.Double** | | [optional] +**string** | **kotlin.String** | | [optional] +**binary** | [**java.io.File**](java.io.File.md) | | [optional] +**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**uuid** | [**java.util.UUID**](java.util.UUID.md) | | [optional] +**patternWithDigits** | **kotlin.String** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**patternWithDigitsAndDelimiter** | **kotlin.String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/HasOnlyReadOnly.md new file mode 100644 index 00000000000..ed3e4750f44 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/HasOnlyReadOnly.md @@ -0,0 +1,11 @@ + +# HasOnlyReadOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **kotlin.String** | | [optional] [readonly] +**foo** | **kotlin.String** | | [optional] [readonly] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/HealthCheckResult.md new file mode 100644 index 00000000000..472dc310457 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/HealthCheckResult.md @@ -0,0 +1,10 @@ + +# HealthCheckResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nullableMessage** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject.md new file mode 100644 index 00000000000..2156c70addf --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject.md @@ -0,0 +1,11 @@ + +# InlineObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | Updated name of the pet | [optional] +**status** | **kotlin.String** | Updated status of the pet | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject1.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject1.md new file mode 100644 index 00000000000..2a77eecba2b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject1.md @@ -0,0 +1,11 @@ + +# InlineObject1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional] +**file** | [**java.io.File**](java.io.File.md) | file to upload | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject2.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject2.md new file mode 100644 index 00000000000..0720925918b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject2.md @@ -0,0 +1,25 @@ + +# InlineObject2 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumFormStringArray** | [**inline**](#kotlin.Array<EnumFormStringArrayEnum>) | Form parameter enum test (string array) | [optional] +**enumFormString** | [**inline**](#EnumFormStringEnum) | Form parameter enum test (string) | [optional] + + + +## Enum: enum_form_string_array +Name | Value +---- | ----- +enumFormStringArray | >, $ + + + +## Enum: enum_form_string +Name | Value +---- | ----- +enumFormString | _abc, -efg, (xyz) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject3.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject3.md new file mode 100644 index 00000000000..4ca6979b280 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject3.md @@ -0,0 +1,23 @@ + +# InlineObject3 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | None | +**double** | **kotlin.Double** | None | +**patternWithoutDelimiter** | **kotlin.String** | None | +**byte** | **kotlin.ByteArray** | None | +**integer** | **kotlin.Int** | None | [optional] +**int32** | **kotlin.Int** | None | [optional] +**int64** | **kotlin.Long** | None | [optional] +**float** | **kotlin.Float** | None | [optional] +**string** | **kotlin.String** | None | [optional] +**binary** | [**java.io.File**](java.io.File.md) | None | [optional] +**date** | [**java.time.LocalDate**](java.time.LocalDate.md) | None | [optional] +**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | None | [optional] +**password** | **kotlin.String** | None | [optional] +**callback** | **kotlin.String** | None | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject4.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject4.md new file mode 100644 index 00000000000..03c4daa7631 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject4.md @@ -0,0 +1,11 @@ + +# InlineObject4 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**param** | **kotlin.String** | field1 | +**param2** | **kotlin.String** | field2 | + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject5.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject5.md new file mode 100644 index 00000000000..c3c020b20f6 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject5.md @@ -0,0 +1,11 @@ + +# InlineObject5 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**requiredFile** | [**java.io.File**](java.io.File.md) | file to upload | +**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineResponseDefault.md new file mode 100644 index 00000000000..afdd81b1383 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineResponseDefault.md @@ -0,0 +1,10 @@ + +# InlineResponseDefault + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string** | [**Foo**](Foo.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/List.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/List.md new file mode 100644 index 00000000000..13a09a4c414 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/List.md @@ -0,0 +1,10 @@ + +# List + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**`123minusList`** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/MapTest.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/MapTest.md new file mode 100644 index 00000000000..8cee39e3604 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/MapTest.md @@ -0,0 +1,20 @@ + +# MapTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapMapOfString** | **kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>** | | [optional] +**mapOfEnumString** | [**inline**](#kotlin.collections.Map<kotlin.String, InnerEnum>) | | [optional] +**directMap** | **kotlin.collections.Map<kotlin.String, kotlin.Boolean>** | | [optional] +**indirectMap** | **kotlin.collections.Map<kotlin.String, kotlin.Boolean>** | | [optional] + + + +## Enum: map_of_enum_string +Name | Value +---- | ----- +mapOfEnumString | UPPER, lower + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..74456741217 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,12 @@ + +# MixedPropertiesAndAdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | [**java.util.UUID**](java.util.UUID.md) | | [optional] +**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**map** | [**kotlin.collections.Map<kotlin.String, Animal>**](Animal.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Name.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Name.md new file mode 100644 index 00000000000..343700533c7 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Name.md @@ -0,0 +1,13 @@ + +# Name + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.Int** | | +**snakeCase** | **kotlin.Int** | | [optional] [readonly] +**property** | **kotlin.String** | | [optional] +**`123number`** | **kotlin.Int** | | [optional] [readonly] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/NullableClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/NullableClass.md new file mode 100644 index 00000000000..9ec43d0b87c --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/NullableClass.md @@ -0,0 +1,21 @@ + +# NullableClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integerProp** | **kotlin.Int** | | [optional] +**numberProp** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] +**booleanProp** | **kotlin.Boolean** | | [optional] +**stringProp** | **kotlin.String** | | [optional] +**dateProp** | [**java.time.LocalDate**](java.time.LocalDate.md) | | [optional] +**datetimeProp** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**arrayNullableProp** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**arrayAndItemsNullableProp** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**arrayItemsNullable** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectNullableProp** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectAndItemsNullableProp** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectItemsNullable** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/NumberOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/NumberOnly.md new file mode 100644 index 00000000000..41e8b82470b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/NumberOnly.md @@ -0,0 +1,10 @@ + +# NumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justNumber** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Order.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Order.md new file mode 100644 index 00000000000..5112f08958d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/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**](#StatusEnum) | Order Status | [optional] +**complete** | **kotlin.Boolean** | | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | placed, approved, delivered + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterComposite.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterComposite.md new file mode 100644 index 00000000000..5296703674d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterComposite.md @@ -0,0 +1,12 @@ + +# OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] +**myString** | **kotlin.String** | | [optional] +**myBoolean** | **kotlin.Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterEnum.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterEnum.md new file mode 100644 index 00000000000..9e7ecb9499a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterEnum.md @@ -0,0 +1,14 @@ + +# OuterEnum + +## Enum + + + * `placed` (value: `"placed"`) + + * `approved` (value: `"approved"`) + + * `delivered` (value: `"delivered"`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterEnumDefaultValue.md new file mode 100644 index 00000000000..821d297a001 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterEnumDefaultValue.md @@ -0,0 +1,14 @@ + +# OuterEnumDefaultValue + +## Enum + + + * `placed` (value: `"placed"`) + + * `approved` (value: `"approved"`) + + * `delivered` (value: `"delivered"`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterEnumInteger.md new file mode 100644 index 00000000000..b40f6e4b7ef --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterEnumInteger.md @@ -0,0 +1,14 @@ + +# OuterEnumInteger + +## Enum + + + * `_0` (value: `0`) + + * `_1` (value: `1`) + + * `_2` (value: `2`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 00000000000..c2fb3ee41d7 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,14 @@ + +# OuterEnumIntegerDefaultValue + +## Enum + + + * `_0` (value: `0`) + + * `_1` (value: `1`) + + * `_2` (value: `2`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Pet.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Pet.md new file mode 100644 index 00000000000..70c340005d1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Pet.md @@ -0,0 +1,22 @@ + +# Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | | +**photoUrls** | **kotlin.Array<kotlin.String>** | | +**id** | **kotlin.Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**tags** | [**kotlin.Array<Tag>**](Tag.md) | | [optional] +**status** | [**inline**](#StatusEnum) | pet status in the store | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | available, pending, sold + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/PetApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/PetApi.md new file mode 100644 index 00000000000..576d2f04ca8 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/PetApi.md @@ -0,0 +1,457 @@ +# 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 +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +try { + apiInstance.addPet(pet) +} catch (e: ClientException) { + println("4xx response calling PetApi#addPet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#addPet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | Pet id to delete +val apiKey : kotlin.String = apiKey_example // kotlin.String | +try { + apiInstance.deletePet(petId, apiKey) +} catch (e: ClientException) { + println("4xx response calling PetApi#deletePet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#deletePet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| Pet id to delete | + **apiKey** | **kotlin.String**| | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **findPetsByStatus** +> kotlin.Array<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val status : kotlin.Array = // kotlin.Array | Status values that need to be considered for filter +try { + val result : kotlin.Array = apiInstance.findPetsByStatus(status) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#findPetsByStatus") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#findPetsByStatus") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + +### Return type + +[**kotlin.Array<Pet>**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **findPetsByTags** +> kotlin.Array<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val tags : kotlin.Array = // kotlin.Array | Tags to filter by +try { + val result : kotlin.Array = apiInstance.findPetsByTags(tags) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#findPetsByTags") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#findPetsByTags") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Tags to filter by | + +### Return type + +[**kotlin.Array<Pet>**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to return +try { + val result : Pet = apiInstance.getPetById(petId) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#getPetById") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#getPetById") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **updatePet** +> updatePet(pet) + +Update an existing pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +try { + apiInstance.updatePet(pet) +} catch (e: ClientException) { + println("4xx response calling PetApi#updatePet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#updatePet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated +val name : kotlin.String = name_example // kotlin.String | Updated name of the pet +val status : kotlin.String = status_example // kotlin.String | Updated status of the pet +try { + apiInstance.updatePetWithForm(petId, name, status) +} catch (e: ClientException) { + println("4xx response calling PetApi#updatePetWithForm") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#updatePetWithForm") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet that needs to be updated | + **name** | **kotlin.String**| Updated name of the pet | [optional] + **status** | **kotlin.String**| Updated status of the pet | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **uploadFile** +> ApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update +val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server +val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload +try { + val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#uploadFile") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#uploadFile") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to update | + **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] + **file** | **java.io.File**| file to upload | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +# **uploadFileWithRequiredFile** +> ApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update +val requiredFile : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload +val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server +try { + val result : ApiResponse = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#uploadFileWithRequiredFile") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#uploadFileWithRequiredFile") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to update | + **requiredFile** | **java.io.File**| file to upload | + **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ReadOnlyFirst.md new file mode 100644 index 00000000000..825f613f090 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ReadOnlyFirst.md @@ -0,0 +1,11 @@ + +# ReadOnlyFirst + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **kotlin.String** | | [optional] [readonly] +**baz** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Return.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Return.md new file mode 100644 index 00000000000..a5437240dc3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Return.md @@ -0,0 +1,10 @@ + +# Return + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**`return`** | **kotlin.Int** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/SpecialModelName.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/SpecialModelName.md new file mode 100644 index 00000000000..282649449d9 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/SpecialModelName.md @@ -0,0 +1,10 @@ + +# SpecialModelname + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **kotlin.Long** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/StoreApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/StoreApi.md new file mode 100644 index 00000000000..55bd8afdbc0 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/StoreApi.md @@ -0,0 +1,196 @@ +# 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 +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted +try { + apiInstance.deleteOrder(orderId) +} catch (e: ClientException) { + println("4xx response calling StoreApi#deleteOrder") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#deleteOrder") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.String**| ID of the order that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **getInventory** +> kotlin.collections.Map<kotlin.String, kotlin.Int> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +try { + val result : kotlin.collections.Map = apiInstance.getInventory() + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#getInventory") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#getInventory") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**kotlin.collections.Map<kotlin.String, kotlin.Int>** + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched +try { + val result : Order = apiInstance.getOrderById(orderId) + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#getOrderById") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#getOrderById") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **placeOrder** +> Order placeOrder(order) + +Place an order for a pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val order : Order = // Order | order placed for purchasing the pet +try { + val result : Order = apiInstance.placeOrder(order) + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#placeOrder") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#placeOrder") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/xml, application/json + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Tag.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Tag.md new file mode 100644 index 00000000000..60ce1bcdbad --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/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/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/User.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/User.md new file mode 100644 index 00000000000..e801729b5ed --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/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/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/UserApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/UserApi.md new file mode 100644 index 00000000000..dbf78e81eb2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/UserApi.md @@ -0,0 +1,376 @@ +# 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 +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : User = // User | Created user object +try { + apiInstance.createUser(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md)| Created user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(user) + +Creates list of users with given input array + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : kotlin.Array = // kotlin.Array | List of user object +try { + apiInstance.createUsersWithArrayInput(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUsersWithArrayInput") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUsersWithArrayInput") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**kotlin.Array<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 + + +# **createUsersWithListInput** +> createUsersWithListInput(user) + +Creates list of users with given input array + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : kotlin.Array = // kotlin.Array | List of user object +try { + apiInstance.createUsersWithListInput(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUsersWithListInput") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUsersWithListInput") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**kotlin.Array<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 + + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The name that needs to be deleted +try { + apiInstance.deleteUser(username) +} catch (e: ClientException) { + println("4xx response calling UserApi#deleteUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#deleteUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The name that needs to be fetched. Use user1 for testing. +try { + val result : User = apiInstance.getUserByName(username) + println(result) +} catch (e: ClientException) { + println("4xx response calling UserApi#getUserByName") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#getUserByName") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **loginUser** +> kotlin.String loginUser(username, password) + +Logs user into the system + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The user name for login +val password : kotlin.String = password_example // kotlin.String | The password for login in clear text +try { + val result : kotlin.String = apiInstance.loginUser(username, password) + println(result) +} catch (e: ClientException) { + println("4xx response calling UserApi#loginUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#loginUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The user name for login | + **password** | **kotlin.String**| The password for login in clear text | + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +try { + apiInstance.logoutUser() +} catch (e: ClientException) { + println("4xx response calling UserApi#logoutUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#logoutUser") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **updateUser** +> updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | name that need to be deleted +val user : User = // User | Updated user object +try { + apiInstance.updateUser(username, user) +} catch (e: ClientException) { + println("4xx response calling UserApi#updateUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#updateUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| name that need to be deleted | + **user** | [**User**](User.md)| Updated user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/settings.gradle b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/settings.gradle new file mode 100644 index 00000000000..b3f1b1a7bbe --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/settings.gradle @@ -0,0 +1,2 @@ + +rootProject.name = 'kotlin-petstore-rx2-client' \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt new file mode 100644 index 00000000000..fe39014a428 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt @@ -0,0 +1,17 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import io.reactivex.Single +import io.reactivex.Completable + +import org.openapitools.client.models.Client + +interface AnotherFakeApi { + @PATCH("/another-fake/dummy") + fun call123testSpecialTags(@Body client: Client): Single + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt new file mode 100644 index 00000000000..9fc3353c5c9 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -0,0 +1,17 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import io.reactivex.Single +import io.reactivex.Completable + +import org.openapitools.client.models.InlineResponseDefault + +interface DefaultApi { + @GET("/foo") + fun fooGet(): Single + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt new file mode 100644 index 00000000000..2bf08fc5918 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt @@ -0,0 +1,67 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import io.reactivex.Single +import io.reactivex.Completable + +import org.openapitools.client.models.Client +import org.openapitools.client.models.FileSchemaTestClass +import org.openapitools.client.models.HealthCheckResult +import org.openapitools.client.models.OuterComposite +import org.openapitools.client.models.Pet +import org.openapitools.client.models.User + +interface FakeApi { + @GET("/fake/health") + fun fakeHealthGet(): Single + + @GET("/fake/http-signature-test") + fun fakeHttpSignatureTest(@Body pet: Pet, @Query("query_1") query1: kotlin.String, @Header("header_1") header1: kotlin.String): Completable + + @POST("/fake/outer/boolean") + fun fakeOuterBooleanSerialize(@Body body: kotlin.Boolean): Single + + @POST("/fake/outer/composite") + fun fakeOuterCompositeSerialize(@Body outerComposite: OuterComposite): Single + + @POST("/fake/outer/number") + fun fakeOuterNumberSerialize(@Body body: java.math.BigDecimal): Single + + @POST("/fake/outer/string") + fun fakeOuterStringSerialize(@Body body: kotlin.String): Single + + @PUT("/fake/body-with-file-schema") + fun testBodyWithFileSchema(@Body fileSchemaTestClass: FileSchemaTestClass): Completable + + @PUT("/fake/body-with-query-params") + fun testBodyWithQueryParams(@Query("query") query: kotlin.String, @Body user: User): Completable + + @PATCH("/fake") + fun testClientModel(@Body client: Client): Single + + @FormUrlEncoded + @POST("/fake") + fun testEndpointParameters(@Field("number") number: java.math.BigDecimal, @Field("double") double: kotlin.Double, @Field("pattern_without_delimiter") patternWithoutDelimiter: kotlin.String, @Field("byte") byte: kotlin.ByteArray, @Field("integer") integer: kotlin.Int, @Field("int32") int32: kotlin.Int, @Field("int64") int64: kotlin.Long, @Field("float") float: kotlin.Float, @Field("string") string: kotlin.String, @Field("binary") binary: MultipartBody.Part, @Field("date") date: java.time.LocalDate, @Field("dateTime") dateTime: java.time.OffsetDateTime, @Field("password") password: kotlin.String, @Field("callback") paramCallback: kotlin.String): Completable + + @FormUrlEncoded + @GET("/fake") + fun testEnumParameters(@Header("enum_header_string_array") enumHeaderStringArray: kotlin.Array, @Header("enum_header_string") enumHeaderString: kotlin.String, @Query("enum_query_string_array") enumQueryStringArray: kotlin.Array, @Query("enum_query_string") enumQueryString: kotlin.String, @Query("enum_query_integer") enumQueryInteger: kotlin.Int, @Query("enum_query_double") enumQueryDouble: kotlin.Double, @Field("enum_form_string_array") enumFormStringArray: kotlin.Array, @Field("enum_form_string") enumFormString: kotlin.String): Completable + + @DELETE("/fake") + fun testGroupParameters(@Query("required_string_group") requiredStringGroup: kotlin.Int, @Header("required_boolean_group") requiredBooleanGroup: kotlin.Boolean, @Query("required_int64_group") requiredInt64Group: kotlin.Long, @Query("string_group") stringGroup: kotlin.Int, @Header("boolean_group") booleanGroup: kotlin.Boolean, @Query("int64_group") int64Group: kotlin.Long): Completable + + @POST("/fake/inline-additionalProperties") + fun testInlineAdditionalProperties(@Body requestBody: kotlin.collections.Map): Completable + + @FormUrlEncoded + @GET("/fake/jsonFormData") + fun testJsonFormData(@Field("param") param: kotlin.String, @Field("param2") param2: kotlin.String): Completable + + @PUT("/fake/test-query-paramters") + fun testQueryParameterCollectionFormat(@Query("pipe") pipe: kotlin.Array, @Query("ioutil") ioutil: CSVParams, @Query("http") http: SPACEParams, @Query("url") url: CSVParams, @Query("context") context: kotlin.Array): Completable + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt new file mode 100644 index 00000000000..1c6fef55066 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt @@ -0,0 +1,17 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import io.reactivex.Single +import io.reactivex.Completable + +import org.openapitools.client.models.Client + +interface FakeClassnameTags123Api { + @PATCH("/fake_classname_test") + fun testClassname(@Body client: Client): Single + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/PetApi.kt new file mode 100644 index 00000000000..078de4d6c92 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -0,0 +1,46 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import io.reactivex.Single +import io.reactivex.Completable + +import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.Pet + +interface PetApi { + @POST("/pet") + fun addPet(@Body pet: Pet): Completable + + @DELETE("/pet/{petId}") + fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String): Completable + + @GET("/pet/findByStatus") + fun findPetsByStatus(@Query("status") status: CSVParams): Single> + + @Deprecated("This api was deprecated") + @GET("/pet/findByTags") + fun findPetsByTags(@Query("tags") tags: CSVParams): Single> + + @GET("/pet/{petId}") + fun getPetById(@Path("petId") petId: kotlin.Long): Single + + @PUT("/pet") + fun updatePet(@Body pet: Pet): Completable + + @FormUrlEncoded + @POST("/pet/{petId}") + fun updatePetWithForm(@Path("petId") petId: kotlin.Long, @Field("name") name: kotlin.String, @Field("status") status: kotlin.String): Completable + + @Multipart + @POST("/pet/{petId}/uploadImage") + fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String, @Part file: MultipartBody.Part): Single + + @Multipart + @POST("/fake/{petId}/uploadImageWithRequiredFile") + fun uploadFileWithRequiredFile(@Path("petId") petId: kotlin.Long, @Part requiredFile: MultipartBody.Part, @Part("additionalMetadata") additionalMetadata: kotlin.String): Single + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt new file mode 100644 index 00000000000..2e877fc382c --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -0,0 +1,26 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import io.reactivex.Single +import io.reactivex.Completable + +import org.openapitools.client.models.Order + +interface StoreApi { + @DELETE("/store/order/{order_id}") + fun deleteOrder(@Path("order_id") orderId: kotlin.String): Completable + + @GET("/store/inventory") + fun getInventory(): Single> + + @GET("/store/order/{order_id}") + fun getOrderById(@Path("order_id") orderId: kotlin.Long): Single + + @POST("/store/order") + fun placeOrder(@Body order: Order): Single + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/UserApi.kt new file mode 100644 index 00000000000..2c1d45116e3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -0,0 +1,38 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import io.reactivex.Single +import io.reactivex.Completable + +import org.openapitools.client.models.User + +interface UserApi { + @POST("/user") + fun createUser(@Body user: User): Completable + + @POST("/user/createWithArray") + fun createUsersWithArrayInput(@Body user: kotlin.Array): Completable + + @POST("/user/createWithList") + fun createUsersWithListInput(@Body user: kotlin.Array): Completable + + @DELETE("/user/{username}") + fun deleteUser(@Path("username") username: kotlin.String): Completable + + @GET("/user/{username}") + fun getUserByName(@Path("username") username: kotlin.String): Single + + @GET("/user/login") + fun loginUser(@Query("username") username: kotlin.String, @Query("password") password: kotlin.String): Single + + @GET("/user/logout") + fun logoutUser(): Completable + + @PUT("/user/{username}") + fun updateUser(@Path("username") username: kotlin.String, @Body user: User): Completable + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt new file mode 100644 index 00000000000..0050437d80a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -0,0 +1,42 @@ +package org.openapitools.client.infrastructure + +import okhttp3.OkHttpClient +import retrofit2.Retrofit +import retrofit2.converter.scalars.ScalarsConverterFactory +import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory +import retrofit2.converter.gson.GsonConverterFactory + +class ApiClient( + private var baseUrl: String = defaultBasePath, + private var okHttpClient: OkHttpClient +) { + companion object { + @JvmStatic + val defaultBasePath: String by lazy { + System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") + } + } + + init { + normalizeBaseUrl() + } + + val retrofitBuilder: Retrofit.Builder by lazy { + + Retrofit.Builder() + .baseUrl(baseUrl) + .addConverterFactory(ScalarsConverterFactory.create()) + .addConverterFactory(GsonConverterFactory.create(Serializer.gson)) + .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) + } + + fun createService(serviceClass: Class): S { + return retrofitBuilder.client(okHttpClient).build().create(serviceClass) + } + + private fun normalizeBaseUrl() { + if (!baseUrl.endsWith("/")) { + baseUrl += "/" + } + } +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt new file mode 100644 index 00000000000..6120b081929 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -0,0 +1,33 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException + +class ByteArrayAdapter : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: ByteArray?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(String(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): ByteArray? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return out.nextString().toByteArray() + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt new file mode 100644 index 00000000000..001e99325d2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/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/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt new file mode 100644 index 00000000000..c5d330ac075 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt @@ -0,0 +1,37 @@ +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/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt new file mode 100644 index 00000000000..30ef6697183 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.LocalDate +import java.time.format.DateTimeFormatter + +class LocalDateAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: LocalDate?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): LocalDate? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return LocalDate.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt new file mode 100644 index 00000000000..3ad781c66ca --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter + +class LocalDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: LocalDateTime?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): LocalDateTime? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return LocalDateTime.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt new file mode 100644 index 00000000000..e615135c9cc --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.OffsetDateTime +import java.time.format.DateTimeFormatter + +class OffsetDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: OffsetDateTime?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): OffsetDateTime? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return OffsetDateTime.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt new file mode 100644 index 00000000000..6465f148553 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -0,0 +1,24 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.Gson +import com.google.gson.GsonBuilder +import java.time.LocalDate +import java.time.LocalDateTime +import java.time.OffsetDateTime +import java.util.UUID +import java.util.Date + +object Serializer { + @JvmStatic + val gsonBuilder: GsonBuilder = GsonBuilder() + .registerTypeAdapter(Date::class.java, DateAdapter()) + .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) + .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) + .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) + .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) + + @JvmStatic + val gson: Gson by lazy { + gsonBuilder.create() + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt new file mode 100644 index 00000000000..6d216739f0b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param mapProperty + * @param mapOfMapProperty + */ + +data class AdditionalPropertiesClass ( + @SerializedName("map_property") + val mapProperty: kotlin.collections.Map? = null, + @SerializedName("map_of_map_property") + val mapOfMapProperty: kotlin.collections.Map>? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Animal.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Animal.kt new file mode 100644 index 00000000000..86992f00d6a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Animal.kt @@ -0,0 +1,33 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param className + * @param color + */ + +interface Animal : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + @get:SerializedName("className") + val className: kotlin.String + @get:SerializedName("color") + val color: kotlin.String? +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt new file mode 100644 index 00000000000..15ea8f6ce57 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -0,0 +1,37 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @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/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt new file mode 100644 index 00000000000..02723cb9dcd --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param arrayArrayNumber + */ + +data class ArrayOfArrayOfNumberOnly ( + @SerializedName("ArrayArrayNumber") + val arrayArrayNumber: kotlin.Array>? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt new file mode 100644 index 00000000000..afde31b7ff4 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param arrayNumber + */ + +data class ArrayOfNumberOnly ( + @SerializedName("ArrayNumber") + val arrayNumber: kotlin.Array? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt new file mode 100644 index 00000000000..d9946e24ba4 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt @@ -0,0 +1,38 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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.ReadOnlyFirst + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param arrayOfString + * @param arrayArrayOfInteger + * @param arrayArrayOfModel + */ + +data class ArrayTest ( + @SerializedName("array_of_string") + val arrayOfString: kotlin.Array? = null, + @SerializedName("array_array_of_integer") + val arrayArrayOfInteger: kotlin.Array>? = null, + @SerializedName("array_array_of_model") + val arrayArrayOfModel: kotlin.Array>? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Capitalization.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Capitalization.kt new file mode 100644 index 00000000000..a7c7d3c9a76 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Capitalization.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param smallCamel + * @param capitalCamel + * @param smallSnake + * @param capitalSnake + * @param scAETHFlowPoints + * @param ATT_NAME Name of the pet + */ + +data class Capitalization ( + @SerializedName("smallCamel") + val smallCamel: kotlin.String? = null, + @SerializedName("CapitalCamel") + val capitalCamel: kotlin.String? = null, + @SerializedName("small_Snake") + val smallSnake: kotlin.String? = null, + @SerializedName("Capital_Snake") + val capitalSnake: kotlin.String? = null, + @SerializedName("SCA_ETH_Flow_Points") + val scAETHFlowPoints: kotlin.String? = null, + /* Name of the pet */ + @SerializedName("ATT_NAME") + val ATT_NAME: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Cat.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Cat.kt new file mode 100644 index 00000000000..3c0b6063ce1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Cat.kt @@ -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.models + +import org.openapitools.client.models.Animal +import org.openapitools.client.models.CatAllOf + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param className + * @param color + * @param declawed + */ + +data class Cat ( + @SerializedName("className") + override val className: kotlin.String, + @SerializedName("color") + override val color: kotlin.String? = null, + @SerializedName("declawed") + val declawed: kotlin.Boolean? = null +) : Animal, Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt new file mode 100644 index 00000000000..7b42c1e2f51 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param declawed + */ + +data class CatAllOf ( + @SerializedName("declawed") + val declawed: kotlin.Boolean? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Category.kt new file mode 100644 index 00000000000..eddd17dc023 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param name + * @param id + */ + +data class Category ( + @SerializedName("name") + val name: kotlin.String, + @SerializedName("id") + val id: kotlin.Long? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ClassModel.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ClassModel.kt new file mode 100644 index 00000000000..d4ca6d61241 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ClassModel.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * Model for testing model with \"_class\" property + * @param propertyClass + */ + +data class ClassModel ( + @SerializedName("_class") + val propertyClass: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Client.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Client.kt new file mode 100644 index 00000000000..2823f40b88b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Client.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param client + */ + +data class Client ( + @SerializedName("client") + val client: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Dog.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Dog.kt new file mode 100644 index 00000000000..fbc06cf1dd6 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Dog.kt @@ -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.models + +import org.openapitools.client.models.Animal +import org.openapitools.client.models.DogAllOf + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param className + * @param color + * @param breed + */ + +data class Dog ( + @SerializedName("className") + override val className: kotlin.String, + @SerializedName("color") + override val color: kotlin.String? = null, + @SerializedName("breed") + val breed: kotlin.String? = null +) : Animal, Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt new file mode 100644 index 00000000000..c422756a65f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param breed + */ + +data class DogAllOf ( + @SerializedName("breed") + val breed: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt new file mode 100644 index 00000000000..8ffe63f244b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param justSymbol + * @param arrayEnum + */ + +data class EnumArrays ( + @SerializedName("just_symbol") + val justSymbol: EnumArrays.JustSymbol? = null, + @SerializedName("array_enum") + val arrayEnum: kotlin.Array? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * + * Values: greaterThanEqual,dollar + */ + + enum class JustSymbol(val value: kotlin.String){ + @SerializedName(value = ">=") greaterThanEqual(">="), + @SerializedName(value = "$") dollar("$"); + } + /** + * + * Values: fish,crab + */ + + enum class ArrayEnum(val value: kotlin.String){ + @SerializedName(value = "fish") fish("fish"), + @SerializedName(value = "crab") crab("crab"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/EnumClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/EnumClass.kt new file mode 100644 index 00000000000..2eccf5d72fa --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/EnumClass.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 + +/** +* +* Values: abc,minusEfg,leftParenthesisXyzRightParenthesis +*/ + +enum class EnumClass(val value: kotlin.String){ + + + @SerializedName(value = "_abc") + abc("_abc"), + + + @SerializedName(value = "-efg") + minusEfg("-efg"), + + + @SerializedName(value = "(xyz)") + leftParenthesisXyzRightParenthesis("(xyz)"); + + + + /** + 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/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/EnumTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/EnumTest.kt new file mode 100644 index 00000000000..a939ed3f41a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/EnumTest.kt @@ -0,0 +1,94 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.OuterEnum +import org.openapitools.client.models.OuterEnumDefaultValue +import org.openapitools.client.models.OuterEnumInteger +import org.openapitools.client.models.OuterEnumIntegerDefaultValue + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param enumStringRequired + * @param enumString + * @param enumInteger + * @param enumNumber + * @param outerEnum + * @param outerEnumInteger + * @param outerEnumDefaultValue + * @param outerEnumIntegerDefaultValue + */ + +data class EnumTest ( + @SerializedName("enum_string_required") + val enumStringRequired: EnumTest.EnumStringRequired, + @SerializedName("enum_string") + val enumString: EnumTest.EnumString? = null, + @SerializedName("enum_integer") + val enumInteger: EnumTest.EnumInteger? = null, + @SerializedName("enum_number") + val enumNumber: EnumTest.EnumNumber? = null, + @SerializedName("outerEnum") + val outerEnum: OuterEnum? = null, + @SerializedName("outerEnumInteger") + val outerEnumInteger: OuterEnumInteger? = null, + @SerializedName("outerEnumDefaultValue") + val outerEnumDefaultValue: OuterEnumDefaultValue? = null, + @SerializedName("outerEnumIntegerDefaultValue") + val outerEnumIntegerDefaultValue: OuterEnumIntegerDefaultValue? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * + * Values: uPPER,lower,eMPTY + */ + + enum class EnumStringRequired(val value: kotlin.String){ + @SerializedName(value = "UPPER") uPPER("UPPER"), + @SerializedName(value = "lower") lower("lower"), + @SerializedName(value = "") eMPTY(""); + } + /** + * + * Values: uPPER,lower,eMPTY + */ + + enum class EnumString(val value: kotlin.String){ + @SerializedName(value = "UPPER") uPPER("UPPER"), + @SerializedName(value = "lower") lower("lower"), + @SerializedName(value = "") eMPTY(""); + } + /** + * + * Values: _1,minus1 + */ + + enum class EnumInteger(val value: kotlin.Int){ + @SerializedName(value = "1") _1(1), + @SerializedName(value = "-1") minus1(-1); + } + /** + * + * Values: _1period1,minus1Period2 + */ + + enum class EnumNumber(val value: kotlin.Double){ + @SerializedName(value = "1.1") _1period1(1.1), + @SerializedName(value = "-1.2") minus1Period2(-1.2); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt new file mode 100644 index 00000000000..8ccd536e097 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param file + * @param files + */ + +data class FileSchemaTestClass ( + @SerializedName("file") + val file: java.io.File? = null, + @SerializedName("files") + val files: kotlin.Array? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Foo.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Foo.kt new file mode 100644 index 00000000000..eac43b98525 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Foo.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param bar + */ + +data class Foo ( + @SerializedName("bar") + val bar: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/FormatTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/FormatTest.kt new file mode 100644 index 00000000000..f8f4fd03128 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/FormatTest.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param number + * @param byte + * @param date + * @param password + * @param integer + * @param int32 + * @param int64 + * @param float + * @param double + * @param string + * @param binary + * @param dateTime + * @param uuid + * @param patternWithDigits A string that is a 10 digit number. Can have leading zeros. + * @param patternWithDigitsAndDelimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + */ + +data class FormatTest ( + @SerializedName("number") + val number: java.math.BigDecimal, + @SerializedName("byte") + val byte: kotlin.ByteArray, + @SerializedName("date") + val date: java.time.LocalDate, + @SerializedName("password") + val password: kotlin.String, + @SerializedName("integer") + val integer: kotlin.Int? = null, + @SerializedName("int32") + val int32: kotlin.Int? = null, + @SerializedName("int64") + val int64: kotlin.Long? = null, + @SerializedName("float") + val float: kotlin.Float? = null, + @SerializedName("double") + val double: kotlin.Double? = null, + @SerializedName("string") + val string: kotlin.String? = null, + @SerializedName("binary") + val binary: java.io.File? = null, + @SerializedName("dateTime") + val dateTime: java.time.OffsetDateTime? = null, + @SerializedName("uuid") + val uuid: java.util.UUID? = null, + /* A string that is a 10 digit number. Can have leading zeros. */ + @SerializedName("pattern_with_digits") + val patternWithDigits: kotlin.String? = null, + /* A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. */ + @SerializedName("pattern_with_digits_and_delimiter") + val patternWithDigitsAndDelimiter: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt new file mode 100644 index 00000000000..e70f3360998 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param bar + * @param foo + */ + +data class HasOnlyReadOnly ( + @SerializedName("bar") + val bar: kotlin.String? = null, + @SerializedName("foo") + val foo: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt new file mode 100644 index 00000000000..5ea4977b7cb --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + * @param nullableMessage + */ + +data class HealthCheckResult ( + @SerializedName("NullableMessage") + val nullableMessage: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject.kt new file mode 100644 index 00000000000..e513221c62b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param name Updated name of the pet + * @param status Updated status of the pet + */ + +data class InlineObject ( + /* Updated name of the pet */ + @SerializedName("name") + val name: kotlin.String? = null, + /* Updated status of the pet */ + @SerializedName("status") + val status: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt new file mode 100644 index 00000000000..183929c471f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + */ + +data class InlineObject1 ( + /* Additional data to pass to server */ + @SerializedName("additionalMetadata") + val additionalMetadata: kotlin.String? = null, + /* file to upload */ + @SerializedName("file") + val file: java.io.File? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt new file mode 100644 index 00000000000..29c4d228fd8 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt @@ -0,0 +1,55 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param enumFormStringArray Form parameter enum test (string array) + * @param enumFormString Form parameter enum test (string) + */ + +data class InlineObject2 ( + /* Form parameter enum test (string array) */ + @SerializedName("enum_form_string_array") + val enumFormStringArray: kotlin.Array? = null, + /* Form parameter enum test (string) */ + @SerializedName("enum_form_string") + val enumFormString: InlineObject2.EnumFormString? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * Form parameter enum test (string array) + * Values: greaterThan,dollar + */ + + enum class EnumFormStringArray(val value: kotlin.String){ + @SerializedName(value = ">") greaterThan(">"), + @SerializedName(value = "$") dollar("$"); + } + /** + * Form parameter enum test (string) + * Values: abc,minusEfg,leftParenthesisXyzRightParenthesis + */ + + enum class EnumFormString(val value: kotlin.String){ + @SerializedName(value = "_abc") abc("_abc"), + @SerializedName(value = "-efg") minusEfg("-efg"), + @SerializedName(value = "(xyz)") leftParenthesisXyzRightParenthesis("(xyz)"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt new file mode 100644 index 00000000000..a5734ebed46 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param number None + * @param double None + * @param patternWithoutDelimiter None + * @param byte None + * @param integer None + * @param int32 None + * @param int64 None + * @param float None + * @param string None + * @param binary None + * @param date None + * @param dateTime None + * @param password None + * @param callback None + */ + +data class InlineObject3 ( + /* None */ + @SerializedName("number") + val number: java.math.BigDecimal, + /* None */ + @SerializedName("double") + val double: kotlin.Double, + /* None */ + @SerializedName("pattern_without_delimiter") + val patternWithoutDelimiter: kotlin.String, + /* None */ + @SerializedName("byte") + val byte: kotlin.ByteArray, + /* None */ + @SerializedName("integer") + val integer: kotlin.Int? = null, + /* None */ + @SerializedName("int32") + val int32: kotlin.Int? = null, + /* None */ + @SerializedName("int64") + val int64: kotlin.Long? = null, + /* None */ + @SerializedName("float") + val float: kotlin.Float? = null, + /* None */ + @SerializedName("string") + val string: kotlin.String? = null, + /* None */ + @SerializedName("binary") + val binary: java.io.File? = null, + /* None */ + @SerializedName("date") + val date: java.time.LocalDate? = null, + /* None */ + @SerializedName("dateTime") + val dateTime: java.time.OffsetDateTime? = null, + /* None */ + @SerializedName("password") + val password: kotlin.String? = null, + /* None */ + @SerializedName("callback") + val callback: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt new file mode 100644 index 00000000000..488f57faff3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param param field1 + * @param param2 field2 + */ + +data class InlineObject4 ( + /* field1 */ + @SerializedName("param") + val param: kotlin.String, + /* field2 */ + @SerializedName("param2") + val param2: kotlin.String +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt new file mode 100644 index 00000000000..1bd7d0c64b8 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param requiredFile file to upload + * @param additionalMetadata Additional data to pass to server + */ + +data class InlineObject5 ( + /* file to upload */ + @SerializedName("requiredFile") + val requiredFile: java.io.File, + /* Additional data to pass to server */ + @SerializedName("additionalMetadata") + val additionalMetadata: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt new file mode 100644 index 00000000000..0252304ee84 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt @@ -0,0 +1,32 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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.Foo + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param string + */ + +data class InlineResponseDefault ( + @SerializedName("string") + val string: Foo? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/List.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/List.kt new file mode 100644 index 00000000000..b7c9f9b029b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/List.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param `123minusList` + */ + +data class List ( + @SerializedName("123-list") + val `123minusList`: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/MapTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/MapTest.kt new file mode 100644 index 00000000000..768f0a76603 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/MapTest.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param mapMapOfString + * @param mapOfEnumString + * @param directMap + * @param indirectMap + */ + +data class MapTest ( + @SerializedName("map_map_of_string") + val mapMapOfString: kotlin.collections.Map>? = null, + @SerializedName("map_of_enum_string") + val mapOfEnumString: MapTest.MapOfEnumString? = null, + @SerializedName("direct_map") + val directMap: kotlin.collections.Map? = null, + @SerializedName("indirect_map") + val indirectMap: kotlin.collections.Map? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * + * Values: uPPER,lower + */ + + enum class MapOfEnumString(val value: kotlin.String){ + @SerializedName(value = "UPPER") uPPER("UPPER"), + @SerializedName(value = "lower") lower("lower"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt new file mode 100644 index 00000000000..ec5c3ba8ead --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt @@ -0,0 +1,38 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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.Animal + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param uuid + * @param dateTime + * @param map + */ + +data class MixedPropertiesAndAdditionalPropertiesClass ( + @SerializedName("uuid") + val uuid: java.util.UUID? = null, + @SerializedName("dateTime") + val dateTime: java.time.OffsetDateTime? = null, + @SerializedName("map") + val map: kotlin.collections.Map? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Model200Response.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Model200Response.kt new file mode 100644 index 00000000000..b9506ce766f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Model200Response.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * Model for testing model name starting with number + * @param name + * @param propertyClass + */ + +data class Model200Response ( + @SerializedName("name") + val name: kotlin.Int? = null, + @SerializedName("class") + val propertyClass: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Name.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Name.kt new file mode 100644 index 00000000000..a26df5946ca --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Name.kt @@ -0,0 +1,40 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * Model for testing model name same as property name + * @param name + * @param snakeCase + * @param property + * @param `123number` + */ + +data class Name ( + @SerializedName("name") + val name: kotlin.Int, + @SerializedName("snake_case") + val snakeCase: kotlin.Int? = null, + @SerializedName("property") + val property: kotlin.String? = null, + @SerializedName("123Number") + val `123number`: kotlin.Int? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/NullableClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/NullableClass.kt new file mode 100644 index 00000000000..44ef32f2637 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/NullableClass.kt @@ -0,0 +1,64 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param integerProp + * @param numberProp + * @param booleanProp + * @param stringProp + * @param dateProp + * @param datetimeProp + * @param arrayNullableProp + * @param arrayAndItemsNullableProp + * @param arrayItemsNullable + * @param objectNullableProp + * @param objectAndItemsNullableProp + * @param objectItemsNullable + */ + +data class NullableClass ( + @SerializedName("integer_prop") + val integerProp: kotlin.Int? = null, + @SerializedName("number_prop") + val numberProp: java.math.BigDecimal? = null, + @SerializedName("boolean_prop") + val booleanProp: kotlin.Boolean? = null, + @SerializedName("string_prop") + val stringProp: kotlin.String? = null, + @SerializedName("date_prop") + val dateProp: java.time.LocalDate? = null, + @SerializedName("datetime_prop") + val datetimeProp: java.time.OffsetDateTime? = null, + @SerializedName("array_nullable_prop") + val arrayNullableProp: kotlin.Array? = null, + @SerializedName("array_and_items_nullable_prop") + val arrayAndItemsNullableProp: kotlin.Array? = null, + @SerializedName("array_items_nullable") + val arrayItemsNullable: kotlin.Array? = null, + @SerializedName("object_nullable_prop") + val objectNullableProp: kotlin.collections.Map? = null, + @SerializedName("object_and_items_nullable_prop") + val objectAndItemsNullableProp: kotlin.collections.Map? = null, + @SerializedName("object_items_nullable") + val objectItemsNullable: kotlin.collections.Map? = null +) : kotlin.collections.HashMap(), Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt new file mode 100644 index 00000000000..ca273d1f3a1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param justNumber + */ + +data class NumberOnly ( + @SerializedName("JustNumber") + val justNumber: java.math.BigDecimal? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Order.kt new file mode 100644 index 00000000000..e691b5ca8fb --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @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/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt new file mode 100644 index 00000000000..8246390507e --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt @@ -0,0 +1,37 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param myNumber + * @param myString + * @param myBoolean + */ + +data class OuterComposite ( + @SerializedName("my_number") + val myNumber: java.math.BigDecimal? = null, + @SerializedName("my_string") + val myString: kotlin.String? = null, + @SerializedName("my_boolean") + val myBoolean: kotlin.Boolean? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt new file mode 100644 index 00000000000..1c2c521eaf5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 + +/** +* +* Values: placed,approved,delivered +*/ + +enum class OuterEnum(val value: kotlin.String){ + + + @SerializedName(value = "placed") + placed("placed"), + + + @SerializedName(value = "approved") + approved("approved"), + + + @SerializedName(value = "delivered") + delivered("delivered"); + + + + /** + 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/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt new file mode 100644 index 00000000000..12c2b0a94aa --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 + +/** +* +* Values: placed,approved,delivered +*/ + +enum class OuterEnumDefaultValue(val value: kotlin.String){ + + + @SerializedName(value = "placed") + placed("placed"), + + + @SerializedName(value = "approved") + approved("approved"), + + + @SerializedName(value = "delivered") + delivered("delivered"); + + + + /** + 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/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt new file mode 100644 index 00000000000..c2ac6a4a936 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 + +/** +* +* Values: _0,_1,_2 +*/ + +enum class OuterEnumInteger(val value: kotlin.Int){ + + + @SerializedName(value = "0") + _0(0), + + + @SerializedName(value = "1") + _1(1), + + + @SerializedName(value = "2") + _2(2); + + + + /** + 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.toString() + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt new file mode 100644 index 00000000000..3066cfbae73 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 + +/** +* +* Values: _0,_1,_2 +*/ + +enum class OuterEnumIntegerDefaultValue(val value: kotlin.Int){ + + + @SerializedName(value = "0") + _0(0), + + + @SerializedName(value = "1") + _1(1), + + + @SerializedName(value = "2") + _2(2); + + + + /** + 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.toString() + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Pet.kt new file mode 100644 index 00000000000..6e0b0b873d1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -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.models + +import org.openapitools.client.models.Category +import org.openapitools.client.models.Tag + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @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.Array, + @SerializedName("id") + val id: kotlin.Long? = null, + @SerializedName("category") + val category: Category? = null, + @SerializedName("tags") + val tags: kotlin.Array? = 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/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt new file mode 100644 index 00000000000..5dff54dc190 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param bar + * @param baz + */ + +data class ReadOnlyFirst ( + @SerializedName("bar") + val bar: kotlin.String? = null, + @SerializedName("baz") + val baz: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Return.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Return.kt new file mode 100644 index 00000000000..ecdce7f408f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Return.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * Model for testing reserved words + * @param `return` + */ + +data class Return ( + @SerializedName("return") + val `return`: kotlin.Int? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt new file mode 100644 index 00000000000..f67aa3c948b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class 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 +/** + * + * @param dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket + */ + +data class SpecialModelname ( + @SerializedName("\$special[property.name]") + val dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket: kotlin.Long? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Tag.kt new file mode 100644 index 00000000000..04ca1914328 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @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/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/User.kt new file mode 100644 index 00000000000..24b8c5d47ac --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/User.kt @@ -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.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @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/openapi3/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION b/samples/openapi3/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION index c3a2c7076fa..b5d898602c2 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/README.md b/samples/openapi3/client/petstore/kotlin-multiplatform/README.md index 36d27771012..aeb7c3ce798 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/README.md +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/README.md @@ -29,6 +29,7 @@ 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* | [**fakeHttpSignatureTest**](docs/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication *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 | @@ -146,6 +147,11 @@ Class | Method | HTTP request | Description - **Type**: HTTP basic authentication + +### http_signature_test + +- **Type**: HTTP basic authentication + ### petstore_auth diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Category.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Category.md index 92c9e2243d6..1f12c3eb158 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Category.md +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Category.md @@ -4,8 +4,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] **name** | **kotlin.String** | | +**id** | **kotlin.Long** | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/EnumTest.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/EnumTest.md index bdef500a433..f0370049eb3 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/EnumTest.md +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/EnumTest.md @@ -4,8 +4,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**enumString** | [**inline**](#EnumStringEnum) | | [optional] **enumStringRequired** | [**inline**](#EnumStringRequiredEnum) | | +**enumString** | [**inline**](#EnumStringEnum) | | [optional] **enumInteger** | [**inline**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**inline**](#EnumNumberEnum) | | [optional] **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] @@ -14,13 +14,6 @@ Name | Type | Description | Notes **outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] - -## Enum: enum_string -Name | Value ----- | ----- -enumString | UPPER, lower, - - ## Enum: enum_string_required Name | Value @@ -28,6 +21,13 @@ Name | Value enumStringRequired | UPPER, lower, + +## Enum: enum_string +Name | Value +---- | ----- +enumString | UPPER, lower, + + ## Enum: enum_integer Name | Value diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FakeApi.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FakeApi.md index 02154eac112..dcb60194b74 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FakeApi.md @@ -5,6 +5,7 @@ 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 | @@ -61,6 +62,54 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json + +# **fakeHttpSignatureTest** +> fakeHttpSignatureTest(pet, query1, header1) + +test http signature authentication + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +val query1 : kotlin.String = query1_example // kotlin.String | query parameter +val header1 : kotlin.String = header1_example // kotlin.String | header parameter +try { + apiInstance.fakeHttpSignatureTest(pet, query1, header1) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeHttpSignatureTest") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeHttpSignatureTest") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **query1** | **kotlin.String**| query parameter | [optional] + **header1** | **kotlin.String**| header parameter | [optional] + +### Return type + +null (empty response body) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + # **fakeOuterBooleanSerialize** > kotlin.Boolean fakeOuterBooleanSerialize(body) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FormatTest.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FormatTest.md index 7f3aec255b4..080b13c2d8e 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FormatTest.md +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FormatTest.md @@ -4,19 +4,19 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**number** | **kotlin.Double** | | +**byte** | [**org.openapitools.client.infrastructure.Base64ByteArray**](org.openapitools.client.infrastructure.Base64ByteArray.md) | | +**date** | **kotlin.String** | | +**password** | **kotlin.String** | | **integer** | **kotlin.Int** | | [optional] **int32** | **kotlin.Int** | | [optional] **int64** | **kotlin.Long** | | [optional] -**number** | **kotlin.Double** | | **float** | **kotlin.Float** | | [optional] **double** | **kotlin.Double** | | [optional] **string** | **kotlin.String** | | [optional] -**byte** | [**org.openapitools.client.infrastructure.Base64ByteArray**](org.openapitools.client.infrastructure.Base64ByteArray.md) | | **binary** | [**org.openapitools.client.infrastructure.OctetByteArray**](org.openapitools.client.infrastructure.OctetByteArray.md) | | [optional] -**date** | **kotlin.String** | | **dateTime** | **kotlin.String** | | [optional] **uuid** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | **patternWithDigits** | **kotlin.String** | A string that is a 10 digit number. Can have leading zeros. | [optional] **patternWithDigitsAndDelimiter** | **kotlin.String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject3.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject3.md index 92279bc2976..450e7d53058 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject3.md +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject3.md @@ -4,15 +4,15 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**number** | **kotlin.Double** | None | +**double** | **kotlin.Double** | None | +**patternWithoutDelimiter** | **kotlin.String** | None | +**byte** | [**org.openapitools.client.infrastructure.Base64ByteArray**](org.openapitools.client.infrastructure.Base64ByteArray.md) | None | **integer** | **kotlin.Int** | None | [optional] **int32** | **kotlin.Int** | None | [optional] **int64** | **kotlin.Long** | None | [optional] -**number** | **kotlin.Double** | None | **float** | **kotlin.Float** | None | [optional] -**double** | **kotlin.Double** | None | **string** | **kotlin.String** | None | [optional] -**patternWithoutDelimiter** | **kotlin.String** | None | -**byte** | [**org.openapitools.client.infrastructure.Base64ByteArray**](org.openapitools.client.infrastructure.Base64ByteArray.md) | None | **binary** | [**org.openapitools.client.infrastructure.OctetByteArray**](org.openapitools.client.infrastructure.OctetByteArray.md) | None | [optional] **date** | **kotlin.String** | None | [optional] **dateTime** | **kotlin.String** | None | [optional] diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject5.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject5.md index fd2cee485c1..47d904d8e2a 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject5.md +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject5.md @@ -4,8 +4,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional] **requiredFile** | [**org.openapitools.client.infrastructure.OctetByteArray**](org.openapitools.client.infrastructure.OctetByteArray.md) | file to upload | +**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional] diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/MapTest.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/MapTest.md index 36a1d460467..8cee39e3604 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/MapTest.md +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/MapTest.md @@ -5,12 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **mapMapOfString** | **kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>** | | [optional] -**mapOfEnumString** | [**inline**](#kotlin.collections.Map<kotlin.String, `inner`Enum>) | | [optional] +**mapOfEnumString** | [**inline**](#kotlin.collections.Map<kotlin.String, InnerEnum>) | | [optional] **directMap** | **kotlin.collections.Map<kotlin.String, kotlin.Boolean>** | | [optional] **indirectMap** | **kotlin.collections.Map<kotlin.String, kotlin.Boolean>** | | [optional] - + ## Enum: map_of_enum_string Name | Value ---- | ----- diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Pet.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Pet.md index ec775600737..70c340005d1 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Pet.md +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Pet.md @@ -4,10 +4,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] **name** | **kotlin.String** | | **photoUrls** | **kotlin.Array<kotlin.String>** | | +**id** | **kotlin.Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] **tags** | [**kotlin.Array<Tag>**](Tag.md) | | [optional] **status** | [**inline**](#StatusEnum) | pet status in the store | [optional] diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/FakeApi.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/FakeApi.kt index 4675fdc4b84..06e0a8ba2d8 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/FakeApi.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/FakeApi.kt @@ -15,6 +15,7 @@ import org.openapitools.client.models.Client import org.openapitools.client.models.FileSchemaTestClass import org.openapitools.client.models.HealthCheckResult import org.openapitools.client.models.OuterComposite +import org.openapitools.client.models.Pet import org.openapitools.client.models.User import org.openapitools.client.infrastructure.* @@ -73,6 +74,42 @@ class FakeApi @UseExperimental(UnstableDefault::class) constructor( } + /** + * test http signature authentication + * + * @param pet Pet object that needs to be added to the store + * @param query1 query parameter (optional) + * @param header1 header parameter (optional) + * @return void + */ + suspend fun fakeHttpSignatureTest(pet: Pet, query1: kotlin.String?, header1: kotlin.String?) : HttpResponse { + + val localVariableAuthNames = listOf("http_signature_test") + + val localVariableBody = pet + + val localVariableQuery = mutableMapOf>() + query1?.apply { localVariableQuery["query_1"] = listOf("$query1") } + + val localVariableHeaders = mutableMapOf() + header1?.apply { localVariableHeaders["header_1"] = this.toString() } + + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/fake/http-signature-test", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return jsonRequest( + localVariableConfig, + localVariableBody, + localVariableAuthNames + ).wrap() + } + + + /** * * Test serialization of outer boolean types @@ -583,6 +620,7 @@ private class TestInlineAdditionalPropertiesRequest(val value: Map? = null, @SerialName(value = "map_of_map_property") val mapOfMapProperty: kotlin.collections.Map>? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Animal.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Animal.kt index a4a0aedb9da..9fe4ece02dd 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Animal.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Animal.kt @@ -20,10 +20,9 @@ import kotlinx.serialization.internal.CommonEnumSerializer * @param color */ @Serializable -data class Animal ( - @SerialName(value = "className") @Required val className: kotlin.String, - @SerialName(value = "color") val color: kotlin.String? = null -) - +interface Animal { + @SerialName(value = "className") @Required val className: kotlin.String + @SerialName(value = "color") val color: kotlin.String? +} diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt index eadb9198bd6..805244a3762 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -25,7 +25,5 @@ data class ApiResponse ( @SerialName(value = "code") val code: kotlin.Int? = null, @SerialName(value = "type") val type: kotlin.String? = null, @SerialName(value = "message") val message: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt index af74669d896..587082fae3d 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt @@ -21,7 +21,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer @Serializable data class ArrayOfArrayOfNumberOnly ( @SerialName(value = "ArrayArrayNumber") val arrayArrayNumber: kotlin.Array>? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt index d495abee8ef..205c7e725e2 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt @@ -21,7 +21,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer @Serializable data class ArrayOfNumberOnly ( @SerialName(value = "ArrayNumber") val arrayNumber: kotlin.Array? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayTest.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayTest.kt index cc1e251cbbf..e4d9e104062 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayTest.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayTest.kt @@ -26,7 +26,5 @@ data class ArrayTest ( @SerialName(value = "array_of_string") val arrayOfString: kotlin.Array? = null, @SerialName(value = "array_array_of_integer") val arrayArrayOfInteger: kotlin.Array>? = null, @SerialName(value = "array_array_of_model") val arrayArrayOfModel: kotlin.Array>? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Capitalization.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Capitalization.kt index be08fe9356b..e960d48879e 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Capitalization.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Capitalization.kt @@ -32,7 +32,5 @@ data class Capitalization ( @SerialName(value = "SCA_ETH_Flow_Points") val scAETHFlowPoints: kotlin.String? = null, /* Name of the pet */ @SerialName(value = "ATT_NAME") val ATT_NAME: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Cat.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Cat.kt index d4934706822..42c192b9302 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Cat.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Cat.kt @@ -18,14 +18,14 @@ import kotlinx.serialization.* import kotlinx.serialization.internal.CommonEnumSerializer /** * + * @param className + * @param color * @param declawed */ @Serializable data class Cat ( - @SerialName(value = "className") @Required val className: kotlin.String, - @SerialName(value = "declawed") val declawed: kotlin.Boolean? = null, - @SerialName(value = "color") val color: kotlin.String? = null -) - - + @SerialName(value = "className") @Required override val className: kotlin.String, + @SerialName(value = "color") override val color: kotlin.String? = null, + @SerialName(value = "declawed") val declawed: kotlin.Boolean? = null +) : Animal diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/CatAllOf.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/CatAllOf.kt index daa6ccbd65b..d7a72badbcd 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/CatAllOf.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/CatAllOf.kt @@ -21,7 +21,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer @Serializable data class CatAllOf ( @SerialName(value = "declawed") val declawed: kotlin.Boolean? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt index c260a3d2cf1..6fb58ac646e 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt @@ -16,14 +16,12 @@ import kotlinx.serialization.* import kotlinx.serialization.internal.CommonEnumSerializer /** * - * @param id * @param name + * @param id */ @Serializable data class Category ( @SerialName(value = "name") @Required val name: kotlin.String, @SerialName(value = "id") val id: kotlin.Long? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ClassModel.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ClassModel.kt index 5944f0f4f0f..c4ea808d23a 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ClassModel.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ClassModel.kt @@ -21,7 +21,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer @Serializable data class ClassModel ( @SerialName(value = "_class") val propertyClass: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Client.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Client.kt index a7e37fa2d36..30d316bd706 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Client.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Client.kt @@ -21,7 +21,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer @Serializable data class Client ( @SerialName(value = "client") val client: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Dog.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Dog.kt index c9dada25891..360f985d755 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Dog.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Dog.kt @@ -18,14 +18,14 @@ import kotlinx.serialization.* import kotlinx.serialization.internal.CommonEnumSerializer /** * + * @param className + * @param color * @param breed */ @Serializable data class Dog ( - @SerialName(value = "className") @Required val className: kotlin.String, - @SerialName(value = "breed") val breed: kotlin.String? = null, - @SerialName(value = "color") val color: kotlin.String? = null -) - - + @SerialName(value = "className") @Required override val className: kotlin.String, + @SerialName(value = "color") override val color: kotlin.String? = null, + @SerialName(value = "breed") val breed: kotlin.String? = null +) : Animal diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/DogAllOf.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/DogAllOf.kt index 335066a664c..6e18a5729e2 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/DogAllOf.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/DogAllOf.kt @@ -21,7 +21,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer @Serializable data class DogAllOf ( @SerialName(value = "breed") val breed: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumArrays.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumArrays.kt index 24712541204..b9598fb80a5 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumArrays.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumArrays.kt @@ -23,10 +23,8 @@ import kotlinx.serialization.internal.CommonEnumSerializer data class EnumArrays ( @SerialName(value = "just_symbol") val justSymbol: EnumArrays.JustSymbol? = null, @SerialName(value = "array_enum") val arrayEnum: kotlin.Array? = null -) +) { - -{ /** * * Values: greaterThanEqual,dollar diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumClass.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumClass.kt index 5028c4e1656..56dd3610741 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumClass.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumClass.kt @@ -33,6 +33,14 @@ enum class EnumClass(val value: kotlin.String){ + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value + } + object Serializer : CommonEnumSerializer("EnumClass", values(), values().map { it.value.toString() }.toTypedArray()) } diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumTest.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumTest.kt index e8118469105..4f1a77e06b9 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumTest.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumTest.kt @@ -20,8 +20,8 @@ import kotlinx.serialization.* import kotlinx.serialization.internal.CommonEnumSerializer /** * - * @param enumString * @param enumStringRequired + * @param enumString * @param enumInteger * @param enumNumber * @param outerEnum @@ -39,22 +39,8 @@ data class EnumTest ( @SerialName(value = "outerEnumInteger") val outerEnumInteger: OuterEnumInteger? = null, @SerialName(value = "outerEnumDefaultValue") val outerEnumDefaultValue: OuterEnumDefaultValue? = null, @SerialName(value = "outerEnumIntegerDefaultValue") val outerEnumIntegerDefaultValue: OuterEnumIntegerDefaultValue? = null -) +) { - -{ - /** - * - * Values: uPPER,lower,eMPTY - */ - @Serializable(with = EnumString.Serializer::class) - enum class EnumString(val value: kotlin.String){ - uPPER("UPPER"), - lower("lower"), - eMPTY(""); - - object Serializer : CommonEnumSerializer("EnumString", values(), values().map { it.value.toString() }.toTypedArray()) - } /** * * Values: uPPER,lower,eMPTY @@ -69,6 +55,18 @@ data class EnumTest ( } /** * + * Values: uPPER,lower,eMPTY + */ + @Serializable(with = EnumString.Serializer::class) + enum class EnumString(val value: kotlin.String){ + uPPER("UPPER"), + lower("lower"), + eMPTY(""); + + object Serializer : CommonEnumSerializer("EnumString", values(), values().map { it.value.toString() }.toTypedArray()) + } + /** + * * Values: _1,minus1 */ @Serializable(with = EnumInteger.Serializer::class) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt index f33eeffe62e..4d09277f953 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt @@ -23,7 +23,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer data class FileSchemaTestClass ( @SerialName(value = "file") val file: org.openapitools.client.infrastructure.OctetByteArray? = null, @SerialName(value = "files") val files: kotlin.Array? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Foo.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Foo.kt index 16666d74e54..f208e3add1d 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Foo.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Foo.kt @@ -21,7 +21,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer @Serializable data class Foo ( @SerialName(value = "bar") val bar: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/FormatTest.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/FormatTest.kt index 728b0d485a7..1d87f25126d 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/FormatTest.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/FormatTest.kt @@ -16,19 +16,19 @@ import kotlinx.serialization.* import kotlinx.serialization.internal.CommonEnumSerializer /** * + * @param number + * @param byte + * @param date + * @param password * @param integer * @param int32 * @param int64 - * @param number * @param float * @param double * @param string - * @param byte * @param binary - * @param date * @param dateTime * @param uuid - * @param password * @param patternWithDigits A string that is a 10 digit number. Can have leading zeros. * @param patternWithDigitsAndDelimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. */ @@ -51,7 +51,5 @@ data class FormatTest ( @SerialName(value = "pattern_with_digits") val patternWithDigits: kotlin.String? = null, /* A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. */ @SerialName(value = "pattern_with_digits_and_delimiter") val patternWithDigitsAndDelimiter: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt index 42e50350bbe..617c8a98b84 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt @@ -23,7 +23,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer data class HasOnlyReadOnly ( @SerialName(value = "bar") val bar: kotlin.String? = null, @SerialName(value = "foo") val foo: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/HealthCheckResult.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/HealthCheckResult.kt index 25c1eb1a2a0..6524d535ce0 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/HealthCheckResult.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/HealthCheckResult.kt @@ -21,7 +21,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer @Serializable data class HealthCheckResult ( @SerialName(value = "NullableMessage") val nullableMessage: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject.kt index f16618c66fb..787f859549f 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject.kt @@ -25,7 +25,5 @@ data class InlineObject ( @SerialName(value = "name") val name: kotlin.String? = null, /* Updated status of the pet */ @SerialName(value = "status") val status: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject1.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject1.kt index 8a8f4b48eb6..bf299be4274 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject1.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject1.kt @@ -25,7 +25,5 @@ data class InlineObject1 ( @SerialName(value = "additionalMetadata") val additionalMetadata: kotlin.String? = null, /* file to upload */ @SerialName(value = "file") val file: org.openapitools.client.infrastructure.OctetByteArray? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject2.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject2.kt index b43c611730f..2f9e4da9784 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject2.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject2.kt @@ -25,10 +25,8 @@ data class InlineObject2 ( @SerialName(value = "enum_form_string_array") val enumFormStringArray: kotlin.Array? = null, /* Form parameter enum test (string) */ @SerialName(value = "enum_form_string") val enumFormString: InlineObject2.EnumFormString? = null -) +) { - -{ /** * Form parameter enum test (string array) * Values: greaterThan,dollar diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject3.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject3.kt index a85b872c57e..62e5c16b090 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject3.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject3.kt @@ -16,15 +16,15 @@ import kotlinx.serialization.* import kotlinx.serialization.internal.CommonEnumSerializer /** * + * @param number None + * @param double None + * @param patternWithoutDelimiter None + * @param byte None * @param integer None * @param int32 None * @param int64 None - * @param number None * @param float None - * @param double None * @param string None - * @param patternWithoutDelimiter None - * @param byte None * @param binary None * @param date None * @param dateTime None @@ -61,7 +61,5 @@ data class InlineObject3 ( @SerialName(value = "password") val password: kotlin.String? = null, /* None */ @SerialName(value = "callback") val callback: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject4.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject4.kt index cd4cb2cd700..4a1f2f2ecc5 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject4.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject4.kt @@ -25,7 +25,5 @@ data class InlineObject4 ( @SerialName(value = "param") @Required val param: kotlin.String, /* field2 */ @SerialName(value = "param2") @Required val param2: kotlin.String -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject5.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject5.kt index 39d77eeb570..d7a7bd0ecce 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject5.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject5.kt @@ -16,8 +16,8 @@ import kotlinx.serialization.* import kotlinx.serialization.internal.CommonEnumSerializer /** * - * @param additionalMetadata Additional data to pass to server * @param requiredFile file to upload + * @param additionalMetadata Additional data to pass to server */ @Serializable data class InlineObject5 ( @@ -25,7 +25,5 @@ data class InlineObject5 ( @SerialName(value = "requiredFile") @Required val requiredFile: org.openapitools.client.infrastructure.OctetByteArray, /* Additional data to pass to server */ @SerialName(value = "additionalMetadata") val additionalMetadata: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineResponseDefault.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineResponseDefault.kt index 8bcddc6c1b7..42564057946 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineResponseDefault.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineResponseDefault.kt @@ -22,7 +22,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer @Serializable data class InlineResponseDefault ( @SerialName(value = "string") val string: Foo? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/List.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/List.kt index 3b63af8f2a4..2768b1935d4 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/List.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/List.kt @@ -21,7 +21,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer @Serializable data class List ( @SerialName(value = "123-list") val `123minusList`: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/MapTest.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/MapTest.kt index e376dc68237..eff239dcfb3 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/MapTest.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/MapTest.kt @@ -27,16 +27,14 @@ data class MapTest ( @SerialName(value = "map_of_enum_string") val mapOfEnumString: MapTest.MapOfEnumString? = null, @SerialName(value = "direct_map") val directMap: kotlin.collections.Map? = null, @SerialName(value = "indirect_map") val indirectMap: kotlin.collections.Map? = null -) +) { - -{ /** * * Values: uPPER,lower */ @Serializable(with = MapOfEnumString.Serializer::class) - enum class MapOfEnumString(val value: kotlin.collections.Map){ + enum class MapOfEnumString(val value: kotlin.String){ uPPER("UPPER"), lower("lower"); diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt index 20923138ee2..73b632b52a6 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt @@ -26,7 +26,5 @@ data class MixedPropertiesAndAdditionalPropertiesClass ( @SerialName(value = "uuid") val uuid: kotlin.String? = null, @SerialName(value = "dateTime") val dateTime: kotlin.String? = null, @SerialName(value = "map") val map: kotlin.collections.Map? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Model200Response.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Model200Response.kt index 2090e911b9c..719b2bd7d25 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Model200Response.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Model200Response.kt @@ -23,7 +23,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer data class Model200Response ( @SerialName(value = "name") val name: kotlin.Int? = null, @SerialName(value = "class") val propertyClass: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Name.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Name.kt index 3a720f71d4e..e010f6a7028 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Name.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Name.kt @@ -27,7 +27,5 @@ data class Name ( @SerialName(value = "snake_case") val snakeCase: kotlin.Int? = null, @SerialName(value = "property") val property: kotlin.String? = null, @SerialName(value = "123Number") val `123number`: kotlin.Int? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/NullableClass.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/NullableClass.kt index a325662a355..e535a63ead0 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/NullableClass.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/NullableClass.kt @@ -43,7 +43,5 @@ data class NullableClass ( @SerialName(value = "object_nullable_prop") val objectNullableProp: kotlin.collections.Map? = null, @SerialName(value = "object_and_items_nullable_prop") val objectAndItemsNullableProp: kotlin.collections.Map? = null, @SerialName(value = "object_items_nullable") val objectItemsNullable: kotlin.collections.Map? = null -) - - +) : kotlin.collections.HashMap() diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/NumberOnly.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/NumberOnly.kt index b8a3f824f9e..28a3ce64289 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/NumberOnly.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/NumberOnly.kt @@ -21,7 +21,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer @Serializable data class NumberOnly ( @SerialName(value = "JustNumber") val justNumber: kotlin.Double? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt index daf7ab61d12..166b3862682 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt @@ -32,10 +32,8 @@ data class Order ( /* Order Status */ @SerialName(value = "status") val status: Order.Status? = null, @SerialName(value = "complete") val complete: kotlin.Boolean? = null -) +) { - -{ /** * Order Status * Values: placed,approved,delivered diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterComposite.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterComposite.kt index 5eb2ff16e16..ab7d6bf2a6f 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterComposite.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterComposite.kt @@ -25,7 +25,5 @@ data class OuterComposite ( @SerialName(value = "my_number") val myNumber: kotlin.Double? = null, @SerialName(value = "my_string") val myString: kotlin.String? = null, @SerialName(value = "my_boolean") val myBoolean: kotlin.Boolean? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnum.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnum.kt index 7d03994603a..4d727954666 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnum.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnum.kt @@ -33,6 +33,14 @@ enum class OuterEnum(val value: kotlin.String){ + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value + } + object Serializer : CommonEnumSerializer("OuterEnum", values(), values().map { it.value.toString() }.toTypedArray()) } diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt index e819231a373..d818ad3a459 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt @@ -33,6 +33,14 @@ enum class OuterEnumDefaultValue(val value: kotlin.String){ + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value + } + object Serializer : CommonEnumSerializer("OuterEnumDefaultValue", values(), values().map { it.value.toString() }.toTypedArray()) } diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumInteger.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumInteger.kt index 0f73f3da8c4..19973003776 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumInteger.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumInteger.kt @@ -33,6 +33,14 @@ enum class OuterEnumInteger(val value: kotlin.Int){ + /** + 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.toString() + } + object Serializer : CommonEnumSerializer("OuterEnumInteger", values(), values().map { it.value.toString() }.toTypedArray()) } diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt index 497d8f1b12c..a46a90efb07 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt @@ -33,6 +33,14 @@ enum class OuterEnumIntegerDefaultValue(val value: kotlin.Int){ + /** + 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.toString() + } + object Serializer : CommonEnumSerializer("OuterEnumIntegerDefaultValue", values(), values().map { it.value.toString() }.toTypedArray()) } diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt index bca3e142602..46c476209ad 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt @@ -18,10 +18,10 @@ import kotlinx.serialization.* import kotlinx.serialization.internal.CommonEnumSerializer /** * - * @param id - * @param category * @param name * @param photoUrls + * @param id + * @param category * @param tags * @param status pet status in the store */ @@ -34,10 +34,8 @@ data class Pet ( @SerialName(value = "tags") val tags: kotlin.Array? = null, /* pet status in the store */ @SerialName(value = "status") val status: Pet.Status? = null -) +) { - -{ /** * pet status in the store * Values: available,pending,sold diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt index 77e15e87cf7..4d99ea7a9a2 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt @@ -23,7 +23,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer data class ReadOnlyFirst ( @SerialName(value = "bar") val bar: kotlin.String? = null, @SerialName(value = "baz") val baz: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Return.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Return.kt index a6f2bf313c9..c4e80831628 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Return.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Return.kt @@ -21,7 +21,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer @Serializable data class Return ( @SerialName(value = "return") val `return`: kotlin.Int? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/SpecialModelname.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/SpecialModelname.kt index eb395fbe570..20dd7ada279 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/SpecialModelname.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/SpecialModelname.kt @@ -21,7 +21,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer @Serializable data class SpecialModelname ( @SerialName(value = "\$special[property.name]") val dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket: kotlin.Long? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt index d0b206966f1..0b3f202ad51 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt @@ -23,7 +23,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer data class Tag ( @SerialName(value = "id") val id: kotlin.Long? = null, @SerialName(value = "name") val name: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt index 71d86c975ff..47ad0a9f282 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt @@ -36,7 +36,5 @@ data class User ( @SerialName(value = "phone") val phone: kotlin.String? = null, /* User Status */ @SerialName(value = "userStatus") val userStatus: kotlin.Int? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION b/samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION index c3a2c7076fa..b5d898602c2 100644 --- a/samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin/README.md b/samples/openapi3/client/petstore/kotlin/README.md index 3738c4b9c91..b7028d917a2 100644 --- a/samples/openapi3/client/petstore/kotlin/README.md +++ b/samples/openapi3/client/petstore/kotlin/README.md @@ -38,6 +38,7 @@ 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* | [**fakeHttpSignatureTest**](docs/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication *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 | @@ -155,6 +156,11 @@ Class | Method | HTTP request | Description - **Type**: HTTP basic authentication + +### http_signature_test + +- **Type**: HTTP basic authentication + ### petstore_auth diff --git a/samples/openapi3/client/petstore/kotlin/build.gradle b/samples/openapi3/client/petstore/kotlin/build.gradle index 98ac4f243e6..56be0bd0dd8 100644 --- a/samples/openapi3/client/petstore/kotlin/build.gradle +++ b/samples/openapi3/client/petstore/kotlin/build.gradle @@ -7,10 +7,10 @@ wrapper { } buildscript { - ext.kotlin_version = '1.3.41' + ext.kotlin_version = '1.3.61' repositories { - mavenCentral() + maven { url "https://repo1.maven.org/maven2" } } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" @@ -20,7 +20,7 @@ buildscript { apply plugin: 'kotlin' repositories { - mavenCentral() + maven { url "https://repo1.maven.org/maven2" } } test { @@ -30,8 +30,8 @@ test { dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" - compile "com.squareup.moshi:moshi-kotlin:1.8.0" - compile "com.squareup.moshi:moshi-adapters:1.8.0" - compile "com.squareup.okhttp3:okhttp:4.2.0" - testImplementation "io.kotlintest:kotlintest-runner-junit5:3.1.0" + compile "com.squareup.moshi:moshi-kotlin:1.9.2" + compile "com.squareup.moshi:moshi-adapters:1.9.2" + compile "com.squareup.okhttp3:okhttp:4.2.2" + testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0" } diff --git a/samples/openapi3/client/petstore/kotlin/docs/Category.md b/samples/openapi3/client/petstore/kotlin/docs/Category.md index 92c9e2243d6..1f12c3eb158 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/Category.md +++ b/samples/openapi3/client/petstore/kotlin/docs/Category.md @@ -4,8 +4,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] **name** | **kotlin.String** | | +**id** | **kotlin.Long** | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin/docs/EnumTest.md b/samples/openapi3/client/petstore/kotlin/docs/EnumTest.md index bdef500a433..f0370049eb3 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/EnumTest.md +++ b/samples/openapi3/client/petstore/kotlin/docs/EnumTest.md @@ -4,8 +4,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**enumString** | [**inline**](#EnumStringEnum) | | [optional] **enumStringRequired** | [**inline**](#EnumStringRequiredEnum) | | +**enumString** | [**inline**](#EnumStringEnum) | | [optional] **enumInteger** | [**inline**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**inline**](#EnumNumberEnum) | | [optional] **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] @@ -14,13 +14,6 @@ Name | Type | Description | Notes **outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] - -## Enum: enum_string -Name | Value ----- | ----- -enumString | UPPER, lower, - - ## Enum: enum_string_required Name | Value @@ -28,6 +21,13 @@ Name | Value enumStringRequired | UPPER, lower, + +## Enum: enum_string +Name | Value +---- | ----- +enumString | UPPER, lower, + + ## Enum: enum_integer Name | Value diff --git a/samples/openapi3/client/petstore/kotlin/docs/FakeApi.md b/samples/openapi3/client/petstore/kotlin/docs/FakeApi.md index afacd58744b..fb663183f92 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/kotlin/docs/FakeApi.md @@ -5,6 +5,7 @@ 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 | @@ -61,6 +62,54 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json + +# **fakeHttpSignatureTest** +> fakeHttpSignatureTest(pet, query1, header1) + +test http signature authentication + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +val query1 : kotlin.String = query1_example // kotlin.String | query parameter +val header1 : kotlin.String = header1_example // kotlin.String | header parameter +try { + apiInstance.fakeHttpSignatureTest(pet, query1, header1) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeHttpSignatureTest") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeHttpSignatureTest") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **query1** | **kotlin.String**| query parameter | [optional] + **header1** | **kotlin.String**| header parameter | [optional] + +### Return type + +null (empty response body) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + # **fakeOuterBooleanSerialize** > kotlin.Boolean fakeOuterBooleanSerialize(body) @@ -414,7 +463,7 @@ val float : kotlin.Float = 3.4 // kotlin.Float | None val string : kotlin.String = string_example // kotlin.String | None val binary : java.io.File = BINARY_DATA_HERE // java.io.File | None val date : java.time.LocalDate = 2013-10-20 // java.time.LocalDate | None -val dateTime : java.time.LocalDateTime = 2013-10-20T19:20:30+01:00 // java.time.LocalDateTime | None +val dateTime : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | None val password : kotlin.String = password_example // kotlin.String | None val paramCallback : kotlin.String = paramCallback_example // kotlin.String | None try { @@ -443,7 +492,7 @@ Name | Type | Description | Notes **string** | **kotlin.String**| None | [optional] **binary** | **java.io.File**| None | [optional] **date** | **java.time.LocalDate**| None | [optional] - **dateTime** | **java.time.LocalDateTime**| None | [optional] + **dateTime** | **java.time.OffsetDateTime**| None | [optional] **password** | **kotlin.String**| None | [optional] **paramCallback** | **kotlin.String**| None | [optional] diff --git a/samples/openapi3/client/petstore/kotlin/docs/FormatTest.md b/samples/openapi3/client/petstore/kotlin/docs/FormatTest.md index 9a339982e00..0357923c97a 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/FormatTest.md +++ b/samples/openapi3/client/petstore/kotlin/docs/FormatTest.md @@ -4,19 +4,19 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | +**byte** | **kotlin.ByteArray** | | +**date** | [**java.time.LocalDate**](java.time.LocalDate.md) | | +**password** | **kotlin.String** | | **integer** | **kotlin.Int** | | [optional] **int32** | **kotlin.Int** | | [optional] **int64** | **kotlin.Long** | | [optional] -**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | **float** | **kotlin.Float** | | [optional] **double** | **kotlin.Double** | | [optional] **string** | **kotlin.String** | | [optional] -**byte** | **kotlin.ByteArray** | | **binary** | [**java.io.File**](java.io.File.md) | | [optional] -**date** | [**java.time.LocalDate**](java.time.LocalDate.md) | | -**dateTime** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | | [optional] +**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] **uuid** | [**java.util.UUID**](java.util.UUID.md) | | [optional] -**password** | **kotlin.String** | | **patternWithDigits** | **kotlin.String** | A string that is a 10 digit number. Can have leading zeros. | [optional] **patternWithDigitsAndDelimiter** | **kotlin.String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] diff --git a/samples/openapi3/client/petstore/kotlin/docs/InlineObject3.md b/samples/openapi3/client/petstore/kotlin/docs/InlineObject3.md index e709b0e1b89..4ca6979b280 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/InlineObject3.md +++ b/samples/openapi3/client/petstore/kotlin/docs/InlineObject3.md @@ -4,18 +4,18 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | None | +**double** | **kotlin.Double** | None | +**patternWithoutDelimiter** | **kotlin.String** | None | +**byte** | **kotlin.ByteArray** | None | **integer** | **kotlin.Int** | None | [optional] **int32** | **kotlin.Int** | None | [optional] **int64** | **kotlin.Long** | None | [optional] -**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | None | **float** | **kotlin.Float** | None | [optional] -**double** | **kotlin.Double** | None | **string** | **kotlin.String** | None | [optional] -**patternWithoutDelimiter** | **kotlin.String** | None | -**byte** | **kotlin.ByteArray** | None | **binary** | [**java.io.File**](java.io.File.md) | None | [optional] **date** | [**java.time.LocalDate**](java.time.LocalDate.md) | None | [optional] -**dateTime** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | None | [optional] +**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | None | [optional] **password** | **kotlin.String** | None | [optional] **callback** | **kotlin.String** | None | [optional] diff --git a/samples/openapi3/client/petstore/kotlin/docs/InlineObject5.md b/samples/openapi3/client/petstore/kotlin/docs/InlineObject5.md index 2eac3943759..c3c020b20f6 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/InlineObject5.md +++ b/samples/openapi3/client/petstore/kotlin/docs/InlineObject5.md @@ -4,8 +4,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional] **requiredFile** | [**java.io.File**](java.io.File.md) | file to upload | +**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional] diff --git a/samples/openapi3/client/petstore/kotlin/docs/MapTest.md b/samples/openapi3/client/petstore/kotlin/docs/MapTest.md index 36a1d460467..8cee39e3604 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/MapTest.md +++ b/samples/openapi3/client/petstore/kotlin/docs/MapTest.md @@ -5,12 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **mapMapOfString** | **kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>** | | [optional] -**mapOfEnumString** | [**inline**](#kotlin.collections.Map<kotlin.String, `inner`Enum>) | | [optional] +**mapOfEnumString** | [**inline**](#kotlin.collections.Map<kotlin.String, InnerEnum>) | | [optional] **directMap** | **kotlin.collections.Map<kotlin.String, kotlin.Boolean>** | | [optional] **indirectMap** | **kotlin.collections.Map<kotlin.String, kotlin.Boolean>** | | [optional] - + ## Enum: map_of_enum_string Name | Value ---- | ----- diff --git a/samples/openapi3/client/petstore/kotlin/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/kotlin/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 293d9cc69f7..74456741217 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/openapi3/client/petstore/kotlin/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **uuid** | [**java.util.UUID**](java.util.UUID.md) | | [optional] -**dateTime** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | | [optional] +**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] **map** | [**kotlin.collections.Map<kotlin.String, Animal>**](Animal.md) | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin/docs/NullableClass.md b/samples/openapi3/client/petstore/kotlin/docs/NullableClass.md index 6b15b13fc9b..9ec43d0b87c 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/NullableClass.md +++ b/samples/openapi3/client/petstore/kotlin/docs/NullableClass.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **booleanProp** | **kotlin.Boolean** | | [optional] **stringProp** | **kotlin.String** | | [optional] **dateProp** | [**java.time.LocalDate**](java.time.LocalDate.md) | | [optional] -**datetimeProp** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | | [optional] +**datetimeProp** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] **arrayNullableProp** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] **arrayAndItemsNullableProp** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] **arrayItemsNullable** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin/docs/Order.md b/samples/openapi3/client/petstore/kotlin/docs/Order.md index ef31dbf2f4f..5112f08958d 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/Order.md +++ b/samples/openapi3/client/petstore/kotlin/docs/Order.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **id** | **kotlin.Long** | | [optional] **petId** | **kotlin.Long** | | [optional] **quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | | [optional] +**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] **status** | [**inline**](#StatusEnum) | Order Status | [optional] **complete** | **kotlin.Boolean** | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin/docs/Pet.md b/samples/openapi3/client/petstore/kotlin/docs/Pet.md index ec775600737..70c340005d1 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/Pet.md +++ b/samples/openapi3/client/petstore/kotlin/docs/Pet.md @@ -4,10 +4,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] **name** | **kotlin.String** | | **photoUrls** | **kotlin.Array<kotlin.String>** | | +**id** | **kotlin.Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] **tags** | [**kotlin.Array<Tag>**](Tag.md) | | [optional] **status** | [**inline**](#StatusEnum) | pet status in the store | [optional] diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt index d72e5dbdab0..ed16413ba9c 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt @@ -25,15 +25,25 @@ import org.openapitools.client.infrastructure.ResponseType import org.openapitools.client.infrastructure.Success import org.openapitools.client.infrastructure.toMultiValue -class AnotherFakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) { +class AnotherFakeApi(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:80/v2") + } + } /** * To test special tags * To test special tags and operation ID starting with number * @param client client model * @return Client + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns 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 call123testSpecialTags(client: Client) : Client { val localVariableBody: kotlin.Any? = client val localVariableQuery: MultiValueMap = mutableMapOf() @@ -44,17 +54,23 @@ class AnotherFakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2 query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Client + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Client ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index 6715f892def..25a92f75348 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -25,14 +25,24 @@ import org.openapitools.client.infrastructure.ResponseType import org.openapitools.client.infrastructure.Success import org.openapitools.client.infrastructure.toMultiValue -class DefaultApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) { +class DefaultApi(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:80/v2") + } + } /** * * * @return InlineResponseDefault + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns 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 fooGet() : InlineResponseDefault { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf() @@ -43,17 +53,23 @@ class DefaultApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as InlineResponseDefault + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as InlineResponseDefault ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt index 55e337e9ac9..740608cb024 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt @@ -15,6 +15,7 @@ import org.openapitools.client.models.Client import org.openapitools.client.models.FileSchemaTestClass import org.openapitools.client.models.HealthCheckResult import org.openapitools.client.models.OuterComposite +import org.openapitools.client.models.Pet import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient @@ -29,14 +30,24 @@ import org.openapitools.client.infrastructure.ResponseType import org.openapitools.client.infrastructure.Success import org.openapitools.client.infrastructure.toMultiValue -class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) { +class FakeApi(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:80/v2") + } + } /** * Health check endpoint * * @return HealthCheckResult + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns 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 fakeHealthGet() : HealthCheckResult { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf() @@ -47,17 +58,70 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as HealthCheckResult + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as HealthCheckResult ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * test http signature authentication + * + * @param pet Pet object that needs to be added to the store + * @param query1 query parameter (optional) + * @param header1 header parameter (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 fakeHttpSignatureTest(pet: Pet, query1: kotlin.String?, header1: kotlin.String?) : Unit { + val localVariableBody: kotlin.Any? = pet + val localVariableQuery: MultiValueMap = mutableMapOf>() + .apply { + if (query1 != null) { + put("query_1", listOf(query1.toString())) + } + } + val localVariableHeaders: MutableMap = mutableMapOf("header_1" to header1.toString()) + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/fake/http-signature-test", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -66,8 +130,12 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * Test serialization of outer boolean types * @param body Input boolean as post body (optional) * @return kotlin.Boolean + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns 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 fakeOuterBooleanSerialize(body: kotlin.Boolean?) : kotlin.Boolean { val localVariableBody: kotlin.Any? = body val localVariableQuery: MultiValueMap = mutableMapOf() @@ -78,17 +146,23 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Boolean + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Boolean ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -97,8 +171,12 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * Test serialization of object with outer number type * @param outerComposite Input composite as post body (optional) * @return OuterComposite + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns 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 fakeOuterCompositeSerialize(outerComposite: OuterComposite?) : OuterComposite { val localVariableBody: kotlin.Any? = outerComposite val localVariableQuery: MultiValueMap = mutableMapOf() @@ -109,17 +187,23 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as OuterComposite + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as OuterComposite ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -128,8 +212,12 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * Test serialization of outer number types * @param body Input number as post body (optional) * @return java.math.BigDecimal + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns 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 fakeOuterNumberSerialize(body: java.math.BigDecimal?) : java.math.BigDecimal { val localVariableBody: kotlin.Any? = body val localVariableQuery: MultiValueMap = mutableMapOf() @@ -140,17 +228,23 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as java.math.BigDecimal + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as java.math.BigDecimal ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -159,8 +253,12 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * Test serialization of outer string types * @param body Input string as post body (optional) * @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 fakeOuterStringSerialize(body: kotlin.String?) : kotlin.String { val localVariableBody: kotlin.Any? = body val localVariableQuery: MultiValueMap = mutableMapOf() @@ -171,17 +269,23 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.String + 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 -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -190,7 +294,11 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * For this test, the body for this request much reference a schema named `File`. * @param fileSchemaTestClass * @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 testBodyWithFileSchema(fileSchemaTestClass: FileSchemaTestClass) : Unit { val localVariableBody: kotlin.Any? = fileSchemaTestClass val localVariableQuery: MultiValueMap = mutableMapOf() @@ -201,17 +309,23 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + 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 -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -221,7 +335,11 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * @param query * @param user * @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 testBodyWithQueryParams(query: kotlin.String, user: User) : Unit { val localVariableBody: kotlin.Any? = user val localVariableQuery: MultiValueMap = mutableMapOf>() @@ -235,17 +353,23 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + 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 -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -254,8 +378,12 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * To test \"client\" model * @param client client model * @return Client + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns 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 testClientModel(client: Client) : Client { val localVariableBody: kotlin.Any? = client val localVariableQuery: MultiValueMap = mutableMapOf() @@ -266,17 +394,23 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Client + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Client ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -298,28 +432,38 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * @param password None (optional) * @param paramCallback None (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 */ - fun testEndpointParameters(number: java.math.BigDecimal, double: kotlin.Double, patternWithoutDelimiter: kotlin.String, byte: kotlin.ByteArray, integer: kotlin.Int?, int32: kotlin.Int?, int64: kotlin.Long?, float: kotlin.Float?, string: kotlin.String?, binary: java.io.File?, date: java.time.LocalDate?, dateTime: java.time.LocalDateTime?, password: kotlin.String?, paramCallback: kotlin.String?) : Unit { - val localVariableBody: kotlin.Any? = mapOf("integer" to "$integer", "int32" to "$int32", "int64" to "$int64", "number" to "$number", "float" to "$float", "double" to "$double", "string" to "$string", "pattern_without_delimiter" to "$patternWithoutDelimiter", "byte" to "$byte", "binary" to "$binary", "date" to "$date", "dateTime" to "$dateTime", "password" to "$password", "callback" to "$paramCallback") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun testEndpointParameters(number: java.math.BigDecimal, double: kotlin.Double, patternWithoutDelimiter: kotlin.String, byte: kotlin.ByteArray, integer: kotlin.Int?, int32: kotlin.Int?, int64: kotlin.Long?, float: kotlin.Float?, string: kotlin.String?, binary: java.io.File?, date: java.time.LocalDate?, dateTime: java.time.OffsetDateTime?, password: kotlin.String?, paramCallback: kotlin.String?) : Unit { + val localVariableBody: kotlin.Any? = mapOf("integer" to integer, "int32" to int32, "int64" to int64, "number" to number, "float" to float, "double" to double, "string" to string, "pattern_without_delimiter" to patternWithoutDelimiter, "byte" to byte, "binary" to binary, "date" to date, "dateTime" to dateTime, "password" to password, "callback" to paramCallback) val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") val localVariableConfig = RequestConfig( RequestMethod.POST, "/fake", query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + 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 -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -335,42 +479,52 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * @param enumFormStringArray Form parameter enum test (string array) (optional, default to '$') * @param enumFormString Form parameter enum test (string) (optional, default to '-efg') * @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 testEnumParameters(enumHeaderStringArray: kotlin.Array?, enumHeaderString: kotlin.String?, enumQueryStringArray: kotlin.Array?, enumQueryString: kotlin.String?, enumQueryInteger: kotlin.Int?, enumQueryDouble: kotlin.Double?, enumFormStringArray: kotlin.Array?, enumFormString: kotlin.String?) : Unit { - val localVariableBody: kotlin.Any? = mapOf("enum_form_string_array" to "$enumFormStringArray", "enum_form_string" to "$enumFormString") + val localVariableBody: kotlin.Any? = mapOf("enum_form_string_array" to enumFormStringArray, "enum_form_string" to enumFormString) val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { if (enumQueryStringArray != null) { - put("enumQueryStringArray", toMultiValue(enumQueryStringArray.toList(), "multi")) + put("enum_query_string_array", toMultiValue(enumQueryStringArray.toList(), "multi")) } if (enumQueryString != null) { - put("enumQueryString", listOf(enumQueryString.toString())) + put("enum_query_string", listOf(enumQueryString.toString())) } if (enumQueryInteger != null) { - put("enumQueryInteger", listOf(enumQueryInteger.toString())) + put("enum_query_integer", listOf(enumQueryInteger.toString())) } if (enumQueryDouble != null) { - put("enumQueryDouble", listOf(enumQueryDouble.toString())) + put("enum_query_double", listOf(enumQueryDouble.toString())) } } - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "", "enum_header_string_array" to enumHeaderStringArray.joinToString(separator = collectionDelimiter("csv")), "enum_header_string" to enumHeaderString.toString()) + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded", "enum_header_string_array" to enumHeaderStringArray.joinToString(separator = collectionDelimiter("csv")), "enum_header_string" to enumHeaderString.toString()) val localVariableConfig = RequestConfig( RequestMethod.GET, "/fake", query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + 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 -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -384,18 +538,22 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * @param booleanGroup Boolean in group parameters (optional) * @param int64Group Integer in group parameters (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 testGroupParameters(requiredStringGroup: kotlin.Int, requiredBooleanGroup: kotlin.Boolean, requiredInt64Group: kotlin.Long, stringGroup: kotlin.Int?, booleanGroup: kotlin.Boolean?, int64Group: kotlin.Long?) : Unit { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { - put("requiredStringGroup", listOf(requiredStringGroup.toString())) - put("requiredInt64Group", listOf(requiredInt64Group.toString())) + put("required_string_group", listOf(requiredStringGroup.toString())) + put("required_int64_group", listOf(requiredInt64Group.toString())) if (stringGroup != null) { - put("stringGroup", listOf(stringGroup.toString())) + put("string_group", listOf(stringGroup.toString())) } if (int64Group != null) { - put("int64Group", listOf(int64Group.toString())) + put("int64_group", listOf(int64Group.toString())) } } val localVariableHeaders: MutableMap = mutableMapOf("required_boolean_group" to requiredBooleanGroup.toString(), "boolean_group" to booleanGroup.toString()) @@ -405,17 +563,23 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + 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 -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -424,7 +588,11 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * * @param requestBody request body * @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 testInlineAdditionalProperties(requestBody: kotlin.collections.Map) : Unit { val localVariableBody: kotlin.Any? = requestBody val localVariableQuery: MultiValueMap = mutableMapOf() @@ -435,17 +603,23 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + 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 -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -455,28 +629,38 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * @param param field1 * @param param2 field2 * @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 testJsonFormData(param: kotlin.String, param2: kotlin.String) : Unit { - val localVariableBody: kotlin.Any? = mapOf("param" to "$param", "param2" to "$param2") + val localVariableBody: kotlin.Any? = mapOf("param" to param, "param2" to param2) val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") val localVariableConfig = RequestConfig( RequestMethod.GET, "/fake/jsonFormData", query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + 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 -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -489,7 +673,11 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * @param url * @param context * @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 testQueryParameterCollectionFormat(pipe: kotlin.Array, ioutil: kotlin.Array, http: kotlin.Array, url: kotlin.Array, context: kotlin.Array) : Unit { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf>() @@ -507,17 +695,23 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + 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 -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt index b29b2d2d4dc..0145742af68 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt @@ -25,15 +25,25 @@ import org.openapitools.client.infrastructure.ResponseType import org.openapitools.client.infrastructure.Success import org.openapitools.client.infrastructure.toMultiValue -class FakeClassnameTags123Api(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) { +class FakeClassnameTags123Api(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:80/v2") + } + } /** * To test class name in snake case * To test class name in snake case * @param client client model * @return Client + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns 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 testClassname(client: Client) : Client { val localVariableBody: kotlin.Any? = client val localVariableQuery: MultiValueMap = mutableMapOf() @@ -44,17 +54,23 @@ class FakeClassnameTags123Api(basePath: kotlin.String = "http://petstore.swagger query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Client + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Client ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 76c993796ef..b5d5deca904 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -26,14 +26,24 @@ import org.openapitools.client.infrastructure.ResponseType import org.openapitools.client.infrastructure.Success import org.openapitools.client.infrastructure.toMultiValue -class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) { +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:80/v2") + } + } /** * Add a new pet to the store * * @param pet 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(pet: Pet) : Unit { val localVariableBody: kotlin.Any? = pet val localVariableQuery: MultiValueMap = mutableMapOf() @@ -44,17 +54,23 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + 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 -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -64,7 +80,11 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api * @param petId Pet id to delete * @param apiKey (optional) * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf() @@ -75,17 +95,23 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + 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 -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -94,8 +120,12 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return kotlin.Array + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns 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.Array) : kotlin.Array { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf>() @@ -109,17 +139,23 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api query = localVariableQuery, headers = localVariableHeaders ) - val response = request>( + val localVarResponse = request>( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -128,8 +164,12 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return kotlin.Array + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns 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 findPetsByTags(tags: kotlin.Array) : kotlin.Array { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf>() @@ -143,17 +183,23 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api query = localVariableQuery, headers = localVariableHeaders ) - val response = request>( + val localVarResponse = request>( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -162,8 +208,12 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api * Returns a single pet * @param petId ID of pet to return * @return Pet + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf() @@ -174,17 +224,23 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Pet + 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 -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -193,7 +249,11 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api * * @param pet 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(pet: Pet) : Unit { val localVariableBody: kotlin.Any? = pet val localVariableQuery: MultiValueMap = mutableMapOf() @@ -204,17 +264,23 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + 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 -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -225,28 +291,38 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableBody: kotlin.Any? = mapOf("name" to "$name", "status" to "$status") + val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") val localVariableConfig = RequestConfig( RequestMethod.POST, "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + 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 -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -257,29 +333,39 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to "$additionalMetadata", "file" to "$file") + val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") val localVariableConfig = RequestConfig( RequestMethod.POST, "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as ApiResponse + 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 -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -290,29 +376,39 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api * @param requiredFile file to upload * @param additionalMetadata Additional data to pass to server (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 uploadFileWithRequiredFile(petId: kotlin.Long, requiredFile: java.io.File, additionalMetadata: kotlin.String?) : ApiResponse { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to "$additionalMetadata", "requiredFile" to "$requiredFile") + val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "requiredFile" to requiredFile) val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") val localVariableConfig = RequestConfig( RequestMethod.POST, "/fake/{petId}/uploadImageWithRequiredFile".replace("{"+"petId"+"}", "$petId"), query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as ApiResponse + 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 -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 260158983ef..ba702612083 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -25,14 +25,24 @@ import org.openapitools.client.infrastructure.ResponseType import org.openapitools.client.infrastructure.Success import org.openapitools.client.infrastructure.toMultiValue -class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) { +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:80/v2") + } + } /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf() @@ -43,17 +53,23 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + 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 -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -61,8 +77,12 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A * Returns pet inventories by status * Returns a map of status codes to quantities * @return kotlin.collections.Map + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf() @@ -73,17 +93,23 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A query = localVariableQuery, headers = localVariableHeaders ) - val response = request>( + val localVarResponse = request>( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.collections.Map + 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 -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -92,8 +118,12 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return Order + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf() @@ -104,17 +134,23 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Order + 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 -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -123,8 +159,12 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A * * @param order 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(order: Order) : Order { val localVariableBody: kotlin.Any? = order val localVariableQuery: MultiValueMap = mutableMapOf() @@ -135,17 +175,23 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Order + 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 -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 60c86640975..6e05b135cd3 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -25,14 +25,24 @@ import org.openapitools.client.infrastructure.ResponseType import org.openapitools.client.infrastructure.Success import org.openapitools.client.infrastructure.toMultiValue -class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) { +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:80/v2") + } + } /** * Create user * This can only be done by the logged in user. * @param user 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(user: User) : Unit { val localVariableBody: kotlin.Any? = user val localVariableQuery: MultiValueMap = mutableMapOf() @@ -43,17 +53,23 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + 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 -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -62,7 +78,11 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * * @param user 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(user: kotlin.Array) : Unit { val localVariableBody: kotlin.Any? = user val localVariableQuery: MultiValueMap = mutableMapOf() @@ -73,17 +93,23 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + 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 -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -92,7 +118,11 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * * @param user 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(user: kotlin.Array) : Unit { val localVariableBody: kotlin.Any? = user val localVariableQuery: MultiValueMap = mutableMapOf() @@ -103,17 +133,23 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + 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 -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -122,7 +158,11 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf() @@ -133,17 +173,23 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + 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 -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -152,8 +198,12 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * * @param username The name that needs to be fetched. Use user1 for testing. * @return User + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf() @@ -164,17 +214,23 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as User + 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 -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -184,8 +240,12 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * @param username The user name for login * @param password The password for login in clear text * @return kotlin.String + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf>() @@ -200,17 +260,23 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.String + 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 -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -218,7 +284,11 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * Logs out current logged in user session * * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf() @@ -229,17 +299,23 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + 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 -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -249,7 +325,11 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * @param username name that need to be deleted * @param user 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, user: User) : Unit { val localVariableBody: kotlin.Any? = user val localVariableQuery: MultiValueMap = mutableMapOf() @@ -260,17 +340,23 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + 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 -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index d5f717b61aa..d3ca9efeadc 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -1,5 +1,6 @@ package org.openapitools.client.infrastructure +import okhttp3.Credentials import okhttp3.OkHttpClient import okhttp3.RequestBody import okhttp3.RequestBody.Companion.asRequestBody @@ -9,7 +10,16 @@ import okhttp3.HttpUrl.Companion.toHttpUrlOrNull import okhttp3.ResponseBody import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request +import okhttp3.Headers +import okhttp3.MultipartBody import java.io.File +import java.net.URLConnection +import java.util.Date +import java.time.LocalDate +import java.time.LocalDateTime +import java.time.LocalTime +import java.time.OffsetDateTime +import java.time.OffsetTime open class ApiClient(val baseUrl: String) { companion object { @@ -36,17 +46,55 @@ open class ApiClient(val baseUrl: String) { val builder: OkHttpClient.Builder = OkHttpClient.Builder() } + /** + * Guess Content-Type header from the given file (defaults to "application/octet-stream"). + * + * @param file The given file + * @return The guessed Content-Type + */ + protected fun guessContentTypeFromFile(file: File): String { + val contentType = URLConnection.guessContentTypeFromName(file.name) + return contentType ?: "application/octet-stream" + } + protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = when { content is File -> content.asRequestBody( mediaType.toMediaTypeOrNull() ) - mediaType == FormDataMediaType || mediaType == FormUrlEncMediaType -> { + mediaType == FormDataMediaType -> { + MultipartBody.Builder() + .setType(MultipartBody.FORM) + .apply { + // content's type *must* be Map + @Suppress("UNCHECKED_CAST") + (content as Map).forEach { (key, value) -> + if (value is File) { + val partHeaders = Headers.headersOf( + "Content-Disposition", + "form-data; name=\"$key\"; filename=\"${value.name}\"" + ) + val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() + addPart(partHeaders, value.asRequestBody(fileMediaType)) + } else { + val partHeaders = Headers.headersOf( + "Content-Disposition", + "form-data; name=\"$key\"" + ) + addPart( + partHeaders, + parameterToString(value).toRequestBody(null) + ) + } + } + }.build() + } + mediaType == FormUrlEncMediaType -> { FormBody.Builder().apply { - // content's type *must* be Map + // content's type *must* be Map @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, value) + (content as Map).forEach { (key, value) -> + add(key, parameterToString(value)) } }.build() } @@ -93,7 +141,7 @@ open class ApiClient(val baseUrl: String) { } if (requestConfig.headers[Authorization].isNullOrEmpty()) { accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer " + accessToken + requestConfig.headers[Authorization] = "Bearer $accessToken" } } if (requestConfig.headers[Authorization].isNullOrEmpty()) { @@ -105,7 +153,7 @@ open class ApiClient(val baseUrl: String) { } if (requestConfig.headers[Authorization].isNullOrEmpty()) { accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer " + accessToken + requestConfig.headers[Authorization] = "Bearer $accessToken " } } } @@ -178,16 +226,47 @@ open class ApiClient(val baseUrl: String) { response.headers.toMultimap() ) response.isClientError -> return ClientError( + response.message, response.body?.string(), response.code, response.headers.toMultimap() ) else -> return ServerError( - null, + response.message, response.body?.string(), response.code, response.headers.toMultimap() ) } } + + 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/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt index f1a8aecc914..9dc8d8dbbfa 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt @@ -4,7 +4,9 @@ enum class ResponseType { Success, Informational, Redirection, ClientError, ServerError } -abstract class ApiInfrastructureResponse(val responseType: ResponseType) { +interface Response + +abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { abstract val statusCode: Int abstract val headers: Map> } @@ -27,6 +29,7 @@ class Redirection( ) : ApiInfrastructureResponse(ResponseType.Redirection) class ClientError( + val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> = mapOf() diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt index 617ac3fe906..ff5e2a81ee8 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -9,4 +9,4 @@ class ByteArrayAdapter { @FromJson fun fromJson(data: String): ByteArray = data.toByteArray() -} \ No newline at end of file +} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt index 2f3b0157ba7..b5310e71f13 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt @@ -3,38 +3,14 @@ package org.openapitools.client.infrastructure import java.lang.RuntimeException -open class ClientException : RuntimeException { - - /** - * Constructs an [ClientException] with no detail message. - */ - constructor() : super() - - /** - * Constructs an [ClientException] with the specified detail message. - - * @param message the detail message. - */ - constructor(message: kotlin.String) : super(message) +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 : RuntimeException { - - /** - * Constructs an [ServerException] with no detail message. - */ - constructor() : super() - - /** - * Constructs an [ServerException] with the specified detail message. - - * @param message the detail message. - */ - constructor(message: kotlin.String) : super(message) +open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { companion object { private const val serialVersionUID: Long = 456L diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt new file mode 100644 index 00000000000..87437871a31 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt @@ -0,0 +1,19 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.time.OffsetDateTime +import java.time.format.DateTimeFormatter + +class OffsetDateTimeAdapter { + @ToJson + fun toJson(value: OffsetDateTime): String { + return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) + } + + @FromJson + fun fromJson(value: String): OffsetDateTime { + return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) + } + +} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index 7c5a353e0f7..697559b2ec1 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -7,12 +7,17 @@ import java.util.Date object Serializer { @JvmStatic - val moshi: Moshi = Moshi.Builder() + val moshiBuilder: Moshi.Builder = Moshi.Builder() .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) + .add(OffsetDateTimeAdapter()) .add(LocalDateTimeAdapter()) .add(LocalDateAdapter()) .add(UUIDAdapter()) .add(ByteArrayAdapter()) .add(KotlinJsonAdapterFactory()) - .build() + + @JvmStatic + val moshi: Moshi by lazy { + moshiBuilder.build() + } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt index fe775011a95..1c349000634 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt @@ -25,12 +25,10 @@ data class AdditionalPropertiesClass ( val mapProperty: kotlin.collections.Map? = null, @Json(name = "map_of_map_property") val mapOfMapProperty: kotlin.collections.Map>? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Animal.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Animal.kt index 188e1ddc708..6e1d0820cc9 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Animal.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Animal.kt @@ -20,17 +20,14 @@ import java.io.Serializable * @param color */ -data class Animal ( - @Json(name = "className") - val className: kotlin.String, - @Json(name = "color") - val color: kotlin.String? = null -) -: Serializable - -{ +interface Animal : Serializable { companion object { private const val serialVersionUID: Long = 123 } + + @Json(name = "className") + val className: kotlin.String + @Json(name = "color") + val color: kotlin.String? } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index 6df7feef3d9..0a13c7737ed 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -28,12 +28,10 @@ data class ApiResponse ( val type: kotlin.String? = null, @Json(name = "message") val message: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt index 7a302b510f4..05ea7ceb7c8 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt @@ -22,12 +22,10 @@ import java.io.Serializable data class ArrayOfArrayOfNumberOnly ( @Json(name = "ArrayArrayNumber") val arrayArrayNumber: kotlin.Array>? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt index f8b5404b7e1..50a185a83e7 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt @@ -22,12 +22,10 @@ import java.io.Serializable data class ArrayOfNumberOnly ( @Json(name = "ArrayNumber") val arrayNumber: kotlin.Array? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt index 1831ecc889a..9a980272720 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt @@ -29,12 +29,10 @@ data class ArrayTest ( val arrayArrayOfInteger: kotlin.Array>? = null, @Json(name = "array_array_of_model") val arrayArrayOfModel: kotlin.Array>? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Capitalization.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Capitalization.kt index c478ffe9180..fb29c174858 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Capitalization.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Capitalization.kt @@ -38,12 +38,10 @@ data class Capitalization ( /* Name of the pet */ @Json(name = "ATT_NAME") val ATT_NAME: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Cat.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Cat.kt index 48c9727de07..4fcd2af6a6f 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Cat.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Cat.kt @@ -18,22 +18,22 @@ import com.squareup.moshi.Json import java.io.Serializable /** * + * @param className + * @param color * @param declawed */ data class Cat ( @Json(name = "className") - val className: kotlin.String, - @Json(name = "declawed") - val declawed: kotlin.Boolean? = null, + override val className: kotlin.String, @Json(name = "color") - val color: kotlin.String? = null -) -: Serializable - -{ + override val color: kotlin.String? = null, + @Json(name = "declawed") + val declawed: kotlin.Boolean? = null +) : Animal, Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt index 37bc7add21f..a40140de841 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt @@ -22,12 +22,10 @@ import java.io.Serializable data class CatAllOf ( @Json(name = "declawed") val declawed: kotlin.Boolean? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt index 61dc86df218..fe0d03dce81 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -16,8 +16,8 @@ import com.squareup.moshi.Json import java.io.Serializable /** * - * @param id * @param name + * @param id */ data class Category ( @@ -25,12 +25,10 @@ data class Category ( val name: kotlin.String, @Json(name = "id") val id: kotlin.Long? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ClassModel.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ClassModel.kt index 17228f01f48..fe0639b7fb1 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ClassModel.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ClassModel.kt @@ -22,12 +22,10 @@ import java.io.Serializable data class ClassModel ( @Json(name = "_class") val propertyClass: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Client.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Client.kt index c0f91b21a9d..201d4bbbd72 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Client.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Client.kt @@ -22,12 +22,10 @@ import java.io.Serializable data class Client ( @Json(name = "client") val client: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Dog.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Dog.kt index 22414a0efd1..5ffd15879f8 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Dog.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Dog.kt @@ -18,22 +18,22 @@ import com.squareup.moshi.Json import java.io.Serializable /** * + * @param className + * @param color * @param breed */ data class Dog ( @Json(name = "className") - val className: kotlin.String, - @Json(name = "breed") - val breed: kotlin.String? = null, + override val className: kotlin.String, @Json(name = "color") - val color: kotlin.String? = null -) -: Serializable - -{ + override val color: kotlin.String? = null, + @Json(name = "breed") + val breed: kotlin.String? = null +) : Animal, Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt index 086ee4c6a0d..019476d4f63 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt @@ -22,12 +22,10 @@ import java.io.Serializable data class DogAllOf ( @Json(name = "breed") val breed: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt index 2de4461719f..8d9076e627f 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt @@ -25,13 +25,11 @@ data class EnumArrays ( val justSymbol: EnumArrays.JustSymbol? = null, @Json(name = "array_enum") val arrayEnum: kotlin.Array? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + /** * * Values: greaterThanEqual,dollar diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumClass.kt index db8cf07dd99..8bd3f24f829 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumClass.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumClass.kt @@ -35,5 +35,13 @@ enum class EnumClass(val value: kotlin.String){ + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value + } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumTest.kt index 2732b246249..f2b499dedfc 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumTest.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumTest.kt @@ -20,8 +20,8 @@ import com.squareup.moshi.Json import java.io.Serializable /** * - * @param enumString * @param enumStringRequired + * @param enumString * @param enumInteger * @param enumNumber * @param outerEnum @@ -47,23 +47,11 @@ data class EnumTest ( val outerEnumDefaultValue: OuterEnumDefaultValue? = null, @Json(name = "outerEnumIntegerDefaultValue") val outerEnumIntegerDefaultValue: OuterEnumIntegerDefaultValue? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } - /** - * - * Values: uPPER,lower,eMPTY - */ - - enum class EnumString(val value: kotlin.String){ - @Json(name = "UPPER") uPPER("UPPER"), - @Json(name = "lower") lower("lower"), - @Json(name = "") eMPTY(""); - } + /** * * Values: uPPER,lower,eMPTY @@ -76,12 +64,22 @@ data class EnumTest ( } /** * + * Values: uPPER,lower,eMPTY + */ + + enum class EnumString(val value: kotlin.String){ + @Json(name = "UPPER") uPPER("UPPER"), + @Json(name = "lower") lower("lower"), + @Json(name = "") eMPTY(""); + } + /** + * * Values: _1,minus1 */ enum class EnumInteger(val value: kotlin.Int){ - @Json(name = 1) _1(1), - @Json(name = -1) minus1(-1); + @Json(name = "1") _1(1), + @Json(name = "-1") minus1(-1); } /** * @@ -89,8 +87,8 @@ data class EnumTest ( */ enum class EnumNumber(val value: kotlin.Double){ - @Json(name = 1.1) _1period1(1.1), - @Json(name = -1.2) minus1Period2(-1.2); + @Json(name = "1.1") _1period1(1.1), + @Json(name = "-1.2") minus1Period2(-1.2); } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt index 7deb80853b3..877c970780f 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt @@ -25,12 +25,10 @@ data class FileSchemaTestClass ( val file: java.io.File? = null, @Json(name = "files") val files: kotlin.Array? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Foo.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Foo.kt index 57925fce832..34baa08bfa0 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Foo.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Foo.kt @@ -22,12 +22,10 @@ import java.io.Serializable data class Foo ( @Json(name = "bar") val bar: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt index 2b587f520d2..5820c2f7b42 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt @@ -16,19 +16,19 @@ import com.squareup.moshi.Json import java.io.Serializable /** * + * @param number + * @param byte + * @param date + * @param password * @param integer * @param int32 * @param int64 - * @param number * @param float * @param double * @param string - * @param byte * @param binary - * @param date * @param dateTime * @param uuid - * @param password * @param patternWithDigits A string that is a 10 digit number. Can have leading zeros. * @param patternWithDigitsAndDelimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. */ @@ -57,7 +57,7 @@ data class FormatTest ( @Json(name = "binary") val binary: java.io.File? = null, @Json(name = "dateTime") - val dateTime: java.time.LocalDateTime? = null, + val dateTime: java.time.OffsetDateTime? = null, @Json(name = "uuid") val uuid: java.util.UUID? = null, /* A string that is a 10 digit number. Can have leading zeros. */ @@ -66,12 +66,10 @@ data class FormatTest ( /* A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. */ @Json(name = "pattern_with_digits_and_delimiter") val patternWithDigitsAndDelimiter: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt index 949cb4e5b80..e3a09f94c96 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt @@ -25,12 +25,10 @@ data class HasOnlyReadOnly ( val bar: kotlin.String? = null, @Json(name = "foo") val foo: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt index 57c37e9dc60..ad7cfc23b6a 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt @@ -22,12 +22,10 @@ import java.io.Serializable data class HealthCheckResult ( @Json(name = "NullableMessage") val nullableMessage: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject.kt index 91689261680..70ac28e3d53 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject.kt @@ -27,12 +27,10 @@ data class InlineObject ( /* Updated status of the pet */ @Json(name = "status") val status: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt index 7e996c6a4fc..72806f05c96 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt @@ -27,12 +27,10 @@ data class InlineObject1 ( /* file to upload */ @Json(name = "file") val file: java.io.File? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt index bf0980c7228..43f87364d31 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt @@ -27,13 +27,11 @@ data class InlineObject2 ( /* Form parameter enum test (string) */ @Json(name = "enum_form_string") val enumFormString: InlineObject2.EnumFormString? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + /** * Form parameter enum test (string array) * Values: greaterThan,dollar diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt index aacdc7583fc..142b9b788d1 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt @@ -16,15 +16,15 @@ import com.squareup.moshi.Json import java.io.Serializable /** * + * @param number None + * @param double None + * @param patternWithoutDelimiter None + * @param byte None * @param integer None * @param int32 None * @param int64 None - * @param number None * @param float None - * @param double None * @param string None - * @param patternWithoutDelimiter None - * @param byte None * @param binary None * @param date None * @param dateTime None @@ -68,19 +68,17 @@ data class InlineObject3 ( val date: java.time.LocalDate? = null, /* None */ @Json(name = "dateTime") - val dateTime: java.time.LocalDateTime? = null, + val dateTime: java.time.OffsetDateTime? = null, /* None */ @Json(name = "password") val password: kotlin.String? = null, /* None */ @Json(name = "callback") val callback: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt index 58674757a7b..b380c4ce723 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt @@ -27,12 +27,10 @@ data class InlineObject4 ( /* field2 */ @Json(name = "param2") val param2: kotlin.String -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt index 0c7c601bd7d..80b8a1788f2 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt @@ -16,8 +16,8 @@ import com.squareup.moshi.Json import java.io.Serializable /** * - * @param additionalMetadata Additional data to pass to server * @param requiredFile file to upload + * @param additionalMetadata Additional data to pass to server */ data class InlineObject5 ( @@ -27,12 +27,10 @@ data class InlineObject5 ( /* Additional data to pass to server */ @Json(name = "additionalMetadata") val additionalMetadata: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt index de26c4e00b4..d78338d8a8f 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt @@ -23,12 +23,10 @@ import java.io.Serializable data class InlineResponseDefault ( @Json(name = "string") val string: Foo? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt index c24ed15deac..7840b609039 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt @@ -22,12 +22,10 @@ import java.io.Serializable data class List ( @Json(name = "123-list") val `123minusList`: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MapTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MapTest.kt index 376cc143cd7..d3eae1e85ab 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MapTest.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MapTest.kt @@ -31,19 +31,17 @@ data class MapTest ( val directMap: kotlin.collections.Map? = null, @Json(name = "indirect_map") val indirectMap: kotlin.collections.Map? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + /** * * Values: uPPER,lower */ - enum class MapOfEnumString(val value: kotlin.collections.Map){ + enum class MapOfEnumString(val value: kotlin.String){ @Json(name = "UPPER") uPPER("UPPER"), @Json(name = "lower") lower("lower"); } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt index 21d8a098101..44844b5d013 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt @@ -26,15 +26,13 @@ data class MixedPropertiesAndAdditionalPropertiesClass ( @Json(name = "uuid") val uuid: java.util.UUID? = null, @Json(name = "dateTime") - val dateTime: java.time.LocalDateTime? = null, + val dateTime: java.time.OffsetDateTime? = null, @Json(name = "map") val map: kotlin.collections.Map? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Model200Response.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Model200Response.kt index 542405de963..3c92defc46b 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Model200Response.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Model200Response.kt @@ -25,12 +25,10 @@ data class Model200Response ( val name: kotlin.Int? = null, @Json(name = "class") val propertyClass: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Name.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Name.kt index 99df32389af..544fdcc91aa 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Name.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Name.kt @@ -31,12 +31,10 @@ data class Name ( val property: kotlin.String? = null, @Json(name = "123Number") val `123number`: kotlin.Int? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NullableClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NullableClass.kt index afc8d24463f..e5d9c43d2a5 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NullableClass.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NullableClass.kt @@ -42,7 +42,7 @@ data class NullableClass ( @Json(name = "date_prop") val dateProp: java.time.LocalDate? = null, @Json(name = "datetime_prop") - val datetimeProp: java.time.LocalDateTime? = null, + val datetimeProp: java.time.OffsetDateTime? = null, @Json(name = "array_nullable_prop") val arrayNullableProp: kotlin.Array? = null, @Json(name = "array_and_items_nullable_prop") @@ -55,12 +55,10 @@ data class NullableClass ( val objectAndItemsNullableProp: kotlin.collections.Map? = null, @Json(name = "object_items_nullable") val objectItemsNullable: kotlin.collections.Map? = null -) -: Serializable - -{ +) : kotlin.collections.HashMap(), Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt index 15c8dfdcf56..3bc4389e1cc 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt @@ -22,12 +22,10 @@ import java.io.Serializable data class NumberOnly ( @Json(name = "JustNumber") val justNumber: java.math.BigDecimal? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt index b6754577938..a4e0ad8f52d 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -32,19 +32,17 @@ data class Order ( @Json(name = "quantity") val quantity: kotlin.Int? = null, @Json(name = "shipDate") - val shipDate: java.time.LocalDateTime? = null, + 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 - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + /** * Order Status * Values: placed,approved,delivered diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt index 2d2fd9b1c6d..c22ad0b5f8f 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt @@ -28,12 +28,10 @@ data class OuterComposite ( val myString: kotlin.String? = null, @Json(name = "my_boolean") val myBoolean: kotlin.Boolean? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt index 86ce0b25a14..6c5d370c87c 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt @@ -35,5 +35,13 @@ enum class OuterEnum(val value: kotlin.String){ + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value + } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt index bf9e3e79960..f1c4a862434 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt @@ -35,5 +35,13 @@ enum class OuterEnumDefaultValue(val value: kotlin.String){ + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value + } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt index c7345e41ebe..b8f161d126b 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt @@ -35,5 +35,13 @@ enum class OuterEnumInteger(val value: kotlin.Int){ + /** + 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.toString() + } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt index f8435385ea3..97c15f39a2c 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt @@ -35,5 +35,13 @@ enum class OuterEnumIntegerDefaultValue(val value: kotlin.Int){ + /** + 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.toString() + } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt index b8795d4ab53..389a15cf692 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -18,10 +18,10 @@ import com.squareup.moshi.Json import java.io.Serializable /** * - * @param id - * @param category * @param name * @param photoUrls + * @param id + * @param category * @param tags * @param status pet status in the store */ @@ -40,13 +40,11 @@ data class Pet ( /* pet status in the store */ @Json(name = "status") val status: Pet.Status? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + /** * pet status in the store * Values: available,pending,sold diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt index 7265237f9b1..ac09dd089e0 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt @@ -25,12 +25,10 @@ data class ReadOnlyFirst ( val bar: kotlin.String? = null, @Json(name = "baz") val baz: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Return.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Return.kt index 4ee2459c1cf..1d2dd5ac1e9 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Return.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Return.kt @@ -22,12 +22,10 @@ import java.io.Serializable data class Return ( @Json(name = "return") val `return`: kotlin.Int? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt index 2f1e0dea5a4..731a3b05e83 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt @@ -22,12 +22,10 @@ import java.io.Serializable data class SpecialModelname ( @Json(name = "\$special[property.name]") val dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket: kotlin.Long? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt index 13667abe035..6d999d38576 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -25,12 +25,10 @@ data class Tag ( val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt index 4443da984df..fbe6650a914 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt @@ -44,12 +44,10 @@ data class User ( /* User Status */ @Json(name = "userStatus") val userStatus: kotlin.Int? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + }