From 7b543ecf361feeed08129cdf8bfb5448a0aacd05 Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Mon, 30 Mar 2020 01:05:19 +0300 Subject: [PATCH 01/32] Added support Retrofit2(RxJava/RxJava2/Coroutines) to Kotlin client code generator --- .github/.test/samples.json | 18 +++++ bin/kotlin-client-all.sh | 3 + ...in-client-petstore-retrofit2-coroutines.sh | 35 ++++++++++ .../kotlin-client-petstore-retrofit2-rx.sh | 35 ++++++++++ .../kotlin-client-petstore-retrofit2-rx2.sh | 35 ++++++++++ docs/generators/kotlin.md | 3 + .../languages/KotlinClientCodegen.java | 66 +++++++++++++++++++ .../libraries/jvm-retrofit2/api.mustache | 19 +++++- 8 files changed, 211 insertions(+), 3 deletions(-) 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 diff --git a/.github/.test/samples.json b/.github/.test/samples.json index 6a157556aae1..02593e57337e 100644 --- a/.github/.test/samples.json +++ b/.github/.test/samples.json @@ -686,6 +686,24 @@ "Client: Kotlin" ] }, + { + "input": "kotlin-client-petstore-retrofit2-coroutines.sh", + "matches": [ + "Client: Kotlin" + ] + }, + { + "input": "kotlin-client-petstore-retrofit2-rx.sh", + "matches": [ + "Client: Kotlin" + ] + }, + { + "input": "kotlin-client-petstore-retrofit2-rx2.sh", + "matches": [ + "Client: Kotlin" + ] + }, { "input": "kotlin-client-string.sh", "matches": [ diff --git a/bin/kotlin-client-all.sh b/bin/kotlin-client-all.sh index 137c6eb5e898..6374ac10f573 100755 --- a/bin/kotlin-client-all.sh +++ b/bin/kotlin-client-all.sh @@ -7,6 +7,9 @@ ./bin/kotlin-client-okhttp3.sh ./bin/kotlin-client-petstore-multiplatform.sh ./bin/kotlin-client-petstore.sh +./bin/kotlin-client-petstore-retrofit2-coroutines.sh +./bin/kotlin-client-petstore-retrofit2-rx.sh +./bin/kotlin-client-petstore-retrofit2-rx2.sh ./bin/kotlin-client-string.sh ./bin/kotlin-client-threetenbp.sh ./bin/kotlin-client-nullable.sh 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 000000000000..bd5737588c26 --- /dev/null +++ b/bin/openapi3/kotlin-client-petstore-retrofit2-coroutines.sh @@ -0,0 +1,35 @@ +#!/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 + +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,useCoroutines=true -o samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines $@" + +echo "Cleaning previously generated files if any from samples/openapi3/client/petstore/kotlin" +rm -rf samples/openapi3/client/petstore/kotlin + +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 000000000000..9ac3fcee9ec5 --- /dev/null +++ b/bin/openapi3/kotlin-client-petstore-retrofit2-rx.sh @@ -0,0 +1,35 @@ +#!/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 + +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,useRxJava=true -o samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx $@" + +echo "Cleaning previously generated files if any from samples/openapi3/client/petstore/kotlin" +rm -rf samples/openapi3/client/petstore/kotlin + +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 000000000000..6700e1bd3dc6 --- /dev/null +++ b/bin/openapi3/kotlin-client-petstore-retrofit2-rx2.sh @@ -0,0 +1,35 @@ +#!/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 + +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 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2 $@" + +echo "Cleaning previously generated files if any from samples/openapi3/client/petstore/kotlin" +rm -rf samples/openapi3/client/petstore/kotlin + +echo "Generating Kotling client..." +java $JAVA_OPTS -jar $executable $ags diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index f212508f70b9..616fe86102af 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| +|useRxJava|Whether to use the RxJava adapter with the retrofit2 library.| |false| +|useRxJava2|Whether to use the RxJava2 adapter with the retrofit2 library.| |false| +|useCoroutines|Whether to use the Coroutines adapter with the retrofit2 library.| |true| ## IMPORT MAPPING 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 4580ad56a907..25718fb0ea70 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,6 +26,8 @@ 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; @@ -37,6 +39,8 @@ 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 +48,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 DO_NOT_USE_RX = "doNotUseRx"; + public static final String USE_COROUTINES = "useCoroutines"; + public static final String DATE_LIBRARY = "dateLibrary"; public static final String REQUEST_DATE_CONVERTER = "requestDateConverter"; public static final String COLLECTION_TYPE = "collectionType"; @@ -53,6 +62,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; + // 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 = false; + protected boolean useCoroutines = true; public enum DateLibrary { STRING("string"), @@ -177,6 +192,10 @@ public KotlinClientCodegen() { 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 +210,39 @@ public String getHelp() { return "Generates a Kotlin client."; } + public void setUseRxJava(boolean useRxJava) { + this.useRxJava = useRxJava; + this.useRxJava2 = false; + this.doNotUseRxAndCoroutines = false; + this.useCoroutines = false; + } + + public void setUseRxJava2(boolean useRxJava2) { + this.useRxJava2 = useRxJava2; + this.useRxJava = false; + this.doNotUseRxAndCoroutines = false; + this.useCoroutines = false; + } + + 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 +263,20 @@ public void processOpts() { sourceFolder = "src/commonMain/kotlin"; } + // RxJava + if (additionalProperties.containsKey(USE_RX_JAVA) && additionalProperties.containsKey(USE_RX_JAVA2)) { + LOGGER.warn("You specified both RxJava versions 1 and 2 but they are mutually exclusive. Defaulting to v2."); + } else if (additionalProperties.containsKey(USE_RX_JAVA)) { + this.setUseRxJava(Boolean.valueOf(additionalProperties.get(USE_RX_JAVA).toString())); + } + if (additionalProperties.containsKey(USE_RX_JAVA2)) { + this.setUseRxJava2(Boolean.valueOf(additionalProperties.get(USE_RX_JAVA2).toString())); + } + + if (!useRxJava && !useRxJava2 && !useCoroutines) { + additionalProperties.put(DO_NOT_USE_RX, 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/libraries/jvm-retrofit2/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/api.mustache index 66938213465a..a55be6ae43c8 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 @@ -1,11 +1,24 @@ package {{apiPackage}} import {{packageName}}.infrastructure.CollectionFormats.* -import retrofit2.http.* -import retrofit2.Call import okhttp3.RequestBody import okhttp3.ResponseBody import okhttp3.MultipartBody +{{#useRxJava}} +import rx.Observable +{{/useRxJava}} +{{#useRxJava2}} +import io.reactivex.Single +{{/useRxJava2}} +{{^returnType}} +{{#useRxJava2}} +import io.reactivex.Completable +{{/useRxJava2}} +{{/returnType}} +{{#doNotUseRxAndCoroutines}} +import retrofit2.Call +{{/doNotUseRxAndCoroutines}} +import retrofit2.http.* {{#imports}}import {{import}} {{/imports}} @@ -31,7 +44,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}}> + {{#useCoroutines}}suspend {{/useCoroutines}}fun {{operationId}}({{^allParams}}){{/allParams}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}}, {{/hasMore}}{{^hasMore}}){{/hasMore}}{{/allParams}}: {{^doNotUseRxAndCoroutines}}{{#useRxJava}}Single<{{#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}}{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}}{{/isResponseFile}}{{/doNotUseRxAndCoroutines}} {{/operation}} } From 49ac48c06812a5aa331ad74e97802aba995c0846 Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Mon, 30 Mar 2020 01:14:08 +0300 Subject: [PATCH 02/32] Added generated samples for Retrofit2(RxJava/RxJava2/Coroutines) on Kotlin --- bin/ci/kotlin-client-petstore-coroutines.json | 12 + bin/ci/kotlin-client-petstore-rx.json | 12 + bin/ci/kotlin-client-petstore-rx2.json | 12 + .../languages/KotlinClientCodegen.java | 1 - .../.openapi-generator-ignore | 23 + .../.openapi-generator/VERSION | 1 + .../kotlin-jvm-retrofit2-coroutines/README.md | 167 ++++ .../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 | 727 ++++++++++++++++++ .../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 | 61 ++ .../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 | 167 ++++ .../kotlin-jvm-retrofit2-rx/build.gradle | 38 + .../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 | 727 ++++++++++++++++++ .../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 | 62 ++ .../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 | 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-rx2/README.md | 167 ++++ .../kotlin-jvm-retrofit2-rx2/build.gradle | 38 + .../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 | 727 ++++++++++++++++++ .../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 | 63 ++ .../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 | 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 ++ 373 files changed, 16077 insertions(+), 1 deletion(-) create mode 100644 bin/ci/kotlin-client-petstore-coroutines.json create mode 100644 bin/ci/kotlin-client-petstore-rx.json create mode 100644 bin/ci/kotlin-client-petstore-rx2.json 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 diff --git a/bin/ci/kotlin-client-petstore-coroutines.json b/bin/ci/kotlin-client-petstore-coroutines.json new file mode 100644 index 000000000000..d22cd1de3d04 --- /dev/null +++ b/bin/ci/kotlin-client-petstore-coroutines.json @@ -0,0 +1,12 @@ +{ + "artifactId": "kotlin-petstore-client", + "generatorName": "kotlin", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/kotlin", + "templateDir": "modules/openapi-generator/src/main/resources/kotlin-client", + "additionalProperties": { + "dateLibrary": "java8", + "serializableModel": "true", + "useCoroutines" : "true" + } +} \ No newline at end of file diff --git a/bin/ci/kotlin-client-petstore-rx.json b/bin/ci/kotlin-client-petstore-rx.json new file mode 100644 index 000000000000..7b640ef6e72e --- /dev/null +++ b/bin/ci/kotlin-client-petstore-rx.json @@ -0,0 +1,12 @@ +{ + "artifactId": "kotlin-petstore-client", + "generatorName": "kotlin", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/kotlin", + "templateDir": "modules/openapi-generator/src/main/resources/kotlin-client", + "additionalProperties": { + "dateLibrary": "java8", + "serializableModel": "true", + "useRxJava" : "true" + } +} \ No newline at end of file diff --git a/bin/ci/kotlin-client-petstore-rx2.json b/bin/ci/kotlin-client-petstore-rx2.json new file mode 100644 index 000000000000..542fc2e986bf --- /dev/null +++ b/bin/ci/kotlin-client-petstore-rx2.json @@ -0,0 +1,12 @@ +{ + "artifactId": "kotlin-petstore-client", + "generatorName": "kotlin", + "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", + "outputDir": "samples/client/petstore/kotlin", + "templateDir": "modules/openapi-generator/src/main/resources/kotlin-client", + "additionalProperties": { + "dateLibrary": "java8", + "serializableModel": "true", + "useRxJava2" : "true" + } +} \ No newline at end of file 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 25718fb0ea70..466668c5e483 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 @@ -32,7 +32,6 @@ 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; 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 000000000000..7484ee590a38 --- /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 000000000000..b5d898602c2c --- /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 000000000000..3738c4b9c91f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/README.md @@ -0,0 +1,167 @@ +# 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* | [**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 + + +### 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 000000000000..9f83d5b1d793 --- /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 000000000000..53c1edacfb84 --- /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 000000000000..1025301ce946 --- /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 000000000000..5ce5a4972c8c --- /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 000000000000..55d482238db4 --- /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 000000000000..6b4c6bf27795 --- /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 000000000000..23a475664205 --- /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 000000000000..b115a5d54c22 --- /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 000000000000..aa0bbbe936c1 --- /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 000000000000..9d44a82fb7ff --- /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 000000000000..b6da7c47cedd --- /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 000000000000..fb8883197a18 --- /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 000000000000..1f12c3eb1582 --- /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 000000000000..50ad61b51a56 --- /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 000000000000..11afbcf0c9f5 --- /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 000000000000..784be537594d --- /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 000000000000..41d9c6ba0d17 --- /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 000000000000..6b14d5e9147d --- /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 000000000000..719084e5f949 --- /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 000000000000..5ddb262871f9 --- /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 000000000000..f0370049eb3e --- /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 000000000000..6736a3e94e17 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FakeApi.md @@ -0,0 +1,727 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +[**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 + + +# **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 000000000000..962dfd4d2dc2 --- /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 000000000000..089e61862c2a --- /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 000000000000..e3e9918872b3 --- /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 000000000000..0357923c97a5 --- /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 000000000000..ed3e4750f44f --- /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 000000000000..472dc3104571 --- /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 000000000000..2156c70addfe --- /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 000000000000..2a77eecba2b7 --- /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 000000000000..0720925918bf --- /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 000000000000..4ca6979b2806 --- /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 000000000000..03c4daa76318 --- /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 000000000000..c3c020b20f60 --- /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 000000000000..afdd81b1383e --- /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 000000000000..13a09a4c4141 --- /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 000000000000..8cee39e36048 --- /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 000000000000..744567412172 --- /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 000000000000..343700533c72 --- /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 000000000000..9ec43d0b87c6 --- /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 000000000000..41e8b82470bc --- /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 000000000000..5112f08958d5 --- /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 000000000000..5296703674de --- /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 000000000000..9e7ecb9499a4 --- /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 000000000000..821d297a001b --- /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 000000000000..b40f6e4b7ef9 --- /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 000000000000..c2fb3ee41d7a --- /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 000000000000..70c340005d16 --- /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 000000000000..576d2f04ca85 --- /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 000000000000..825f613f0907 --- /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 000000000000..a5437240dc32 --- /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 000000000000..282649449d96 --- /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 000000000000..55bd8afdbc09 --- /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 000000000000..60ce1bcdbad3 --- /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 000000000000..e801729b5ed1 --- /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 000000000000..dbf78e81eb22 --- /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 000000000000..b3f1b1a7bbed --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/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-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 000000000000..21443c59b017 --- /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 okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import retrofit2.http.* + +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 000000000000..f09a149e8cf1 --- /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 okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import retrofit2.http.* + +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 000000000000..e27da1d7eb55 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt @@ -0,0 +1,61 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import retrofit2.http.* + +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.User + +interface FakeApi { + @GET("/fake/health") + suspend fun fakeHealthGet(): HealthCheckResult + + @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 000000000000..01004f1dc880 --- /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 okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import retrofit2.http.* + +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 000000000000..155d7fb21bda --- /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 okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import retrofit2.http.* + +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 000000000000..e30127a6ac36 --- /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 okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import retrofit2.http.* + +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 000000000000..2badde6de5d0 --- /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 okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import retrofit2.http.* + +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 000000000000..085d78c72a53 --- /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 000000000000..6120b081929d --- /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 000000000000..001e99325d2e --- /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 000000000000..c5d330ac0757 --- /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 000000000000..30ef6697183a --- /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 000000000000..3ad781c66ca1 --- /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 000000000000..e615135c9cc0 --- /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 000000000000..6465f1485531 --- /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 000000000000..6d216739f0b2 --- /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 000000000000..3dc523271960 --- /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 + } + + @SerializedName("className") + val className: kotlin.String + @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 000000000000..15ea8f6ce57a --- /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 000000000000..02723cb9dcd9 --- /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 000000000000..afde31b7ff41 --- /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 000000000000..d9946e24ba46 --- /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 000000000000..a7c7d3c9a761 --- /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 000000000000..3c0b6063ce16 --- /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 000000000000..7b42c1e2f515 --- /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 000000000000..eddd17dc0231 --- /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 000000000000..d4ca6d612415 --- /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 000000000000..2823f40b88b5 --- /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 000000000000..fbc06cf1dd61 --- /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 000000000000..c422756a65fa --- /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 000000000000..6e5bcb295e11 --- /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 000000000000..2eccf5d72fa7 --- /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 000000000000..6651549b729e --- /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 000000000000..8ccd536e097a --- /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 000000000000..eac43b985250 --- /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 000000000000..f8f4fd031287 --- /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 000000000000..e70f33609981 --- /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 000000000000..5ea4977b7cb5 --- /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 000000000000..e513221c62ba --- /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 000000000000..183929c471fe --- /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 000000000000..b6a6daa80617 --- /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 000000000000..a5734ebed46d --- /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 000000000000..488f57faff3d --- /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 000000000000..1bd7d0c64b88 --- /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 000000000000..0252304ee847 --- /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 000000000000..b7c9f9b029bb --- /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 000000000000..6b67d9bfc1b4 --- /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.collections.Map){ + @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 000000000000..ec5c3ba8eadb --- /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 000000000000..b9506ce766f2 --- /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 000000000000..a26df5946ca7 --- /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 000000000000..1229f89385fe --- /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.mapOf<String, kotlin.Any>, 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 000000000000..ca273d1f3a17 --- /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 000000000000..b46a1fbeded7 --- /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 000000000000..8246390507ec --- /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 000000000000..1c2c521eaf57 --- /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 000000000000..12c2b0a94aa3 --- /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 000000000000..c2ac6a4a936d --- /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 000000000000..3066cfbae73d --- /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 000000000000..d36717d56f71 --- /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 000000000000..5dff54dc190a --- /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 000000000000..ecdce7f408fb --- /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 000000000000..f67aa3c948b6 --- /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 000000000000..04ca19143287 --- /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 000000000000..24b8c5d47ac2 --- /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 000000000000..7484ee590a38 --- /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 000000000000..b5d898602c2c --- /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 000000000000..3738c4b9c91f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/README.md @@ -0,0 +1,167 @@ +# 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* | [**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 + + +### 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 000000000000..9f83d5b1d793 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/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-rx/docs/200Response.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/200Response.md new file mode 100644 index 000000000000..53c1edacfb84 --- /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 000000000000..1025301ce946 --- /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 000000000000..5ce5a4972c8c --- /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 000000000000..55d482238db4 --- /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 000000000000..6b4c6bf27795 --- /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 000000000000..23a475664205 --- /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 000000000000..b115a5d54c22 --- /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 000000000000..aa0bbbe936c1 --- /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 000000000000..9d44a82fb7ff --- /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 000000000000..b6da7c47cedd --- /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 000000000000..fb8883197a18 --- /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 000000000000..1f12c3eb1582 --- /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 000000000000..50ad61b51a56 --- /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 000000000000..11afbcf0c9f5 --- /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 000000000000..784be537594d --- /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 000000000000..41d9c6ba0d17 --- /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 000000000000..6b14d5e9147d --- /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 000000000000..719084e5f949 --- /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 000000000000..5ddb262871f9 --- /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 000000000000..f0370049eb3e --- /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 000000000000..6736a3e94e17 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FakeApi.md @@ -0,0 +1,727 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +[**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 + + +# **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 000000000000..962dfd4d2dc2 --- /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 000000000000..089e61862c2a --- /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 000000000000..e3e9918872b3 --- /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 000000000000..0357923c97a5 --- /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 000000000000..ed3e4750f44f --- /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 000000000000..472dc3104571 --- /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 000000000000..2156c70addfe --- /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 000000000000..2a77eecba2b7 --- /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 000000000000..0720925918bf --- /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 000000000000..4ca6979b2806 --- /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 000000000000..03c4daa76318 --- /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 000000000000..c3c020b20f60 --- /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 000000000000..afdd81b1383e --- /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 000000000000..13a09a4c4141 --- /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 000000000000..8cee39e36048 --- /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 000000000000..744567412172 --- /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 000000000000..343700533c72 --- /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 000000000000..9ec43d0b87c6 --- /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 000000000000..41e8b82470bc --- /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 000000000000..5112f08958d5 --- /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 000000000000..5296703674de --- /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 000000000000..9e7ecb9499a4 --- /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 000000000000..821d297a001b --- /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 000000000000..b40f6e4b7ef9 --- /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 000000000000..c2fb3ee41d7a --- /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 000000000000..70c340005d16 --- /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 000000000000..576d2f04ca85 --- /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 000000000000..825f613f0907 --- /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 000000000000..a5437240dc32 --- /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 000000000000..282649449d96 --- /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 000000000000..55bd8afdbc09 --- /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 000000000000..60ce1bcdbad3 --- /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 000000000000..e801729b5ed1 --- /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 000000000000..dbf78e81eb22 --- /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 000000000000..b3f1b1a7bbed --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/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-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 000000000000..9d438d7511e8 --- /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 okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import rx.Observable +import retrofit2.http.* + +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-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 000000000000..58bbd5fd41c9 --- /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 okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import rx.Observable +import retrofit2.http.* + +import org.openapitools.client.models.InlineResponseDefault + +interface DefaultApi { + @GET("/foo") + fun fooGet(): Single + +} 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 000000000000..9f0dfb5e1f05 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt @@ -0,0 +1,62 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import rx.Observable +import retrofit2.http.* + +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.User + +interface FakeApi { + @GET("/fake/health") + fun fakeHealthGet(): Single + + @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): Single + + @PUT("/fake/body-with-query-params") + fun testBodyWithQueryParams(@Query("query") query: kotlin.String, @Body user: User): Single + + @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): Single + + @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): Single + + @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): Single + + @POST("/fake/inline-additionalProperties") + fun testInlineAdditionalProperties(@Body requestBody: kotlin.collections.Map): Single + + @FormUrlEncoded + @GET("/fake/jsonFormData") + fun testJsonFormData(@Field("param") param: kotlin.String, @Field("param2") param2: kotlin.String): Single + + @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): Single + +} 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 000000000000..ee2d08f00e3d --- /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 okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import rx.Observable +import retrofit2.http.* + +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-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 000000000000..1bc5438e53d9 --- /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 okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import rx.Observable +import retrofit2.http.* + +import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.Pet + +interface PetApi { + @POST("/pet") + fun addPet(@Body pet: Pet): Single + + @DELETE("/pet/{petId}") + fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String): Single + + @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): Single + + @FormUrlEncoded + @POST("/pet/{petId}") + fun updatePetWithForm(@Path("petId") petId: kotlin.Long, @Field("name") name: kotlin.String, @Field("status") status: kotlin.String): Single + + @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-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 000000000000..01c2aee46b23 --- /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 okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import rx.Observable +import retrofit2.http.* + +import org.openapitools.client.models.Order + +interface StoreApi { + @DELETE("/store/order/{order_id}") + fun deleteOrder(@Path("order_id") orderId: kotlin.String): Single + + @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-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 000000000000..2ac3f5c423b3 --- /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 okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import rx.Observable +import retrofit2.http.* + +import org.openapitools.client.models.User + +interface UserApi { + @POST("/user") + fun createUser(@Body user: User): Single + + @POST("/user/createWithArray") + fun createUsersWithArrayInput(@Body user: kotlin.Array): Single + + @POST("/user/createWithList") + fun createUsersWithListInput(@Body user: kotlin.Array): Single + + @DELETE("/user/{username}") + fun deleteUser(@Path("username") username: kotlin.String): Single + + @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(): Single + + @PUT("/user/{username}") + fun updateUser(@Path("username") username: kotlin.String, @Body user: User): Single + +} 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 000000000000..085d78c72a53 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/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-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 000000000000..6120b081929d --- /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 000000000000..001e99325d2e --- /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 000000000000..c5d330ac0757 --- /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 000000000000..30ef6697183a --- /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 000000000000..3ad781c66ca1 --- /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 000000000000..e615135c9cc0 --- /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 000000000000..6465f1485531 --- /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 000000000000..6d216739f0b2 --- /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 000000000000..3dc523271960 --- /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 + } + + @SerializedName("className") + val className: kotlin.String + @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 000000000000..15ea8f6ce57a --- /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 000000000000..02723cb9dcd9 --- /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 000000000000..afde31b7ff41 --- /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 000000000000..d9946e24ba46 --- /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 000000000000..a7c7d3c9a761 --- /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 000000000000..3c0b6063ce16 --- /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 000000000000..7b42c1e2f515 --- /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 000000000000..eddd17dc0231 --- /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 000000000000..d4ca6d612415 --- /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 000000000000..2823f40b88b5 --- /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 000000000000..fbc06cf1dd61 --- /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 000000000000..c422756a65fa --- /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 000000000000..6e5bcb295e11 --- /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 000000000000..2eccf5d72fa7 --- /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 000000000000..6651549b729e --- /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 000000000000..8ccd536e097a --- /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 000000000000..eac43b985250 --- /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 000000000000..f8f4fd031287 --- /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 000000000000..e70f33609981 --- /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 000000000000..5ea4977b7cb5 --- /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 000000000000..e513221c62ba --- /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 000000000000..183929c471fe --- /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 000000000000..b6a6daa80617 --- /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 000000000000..a5734ebed46d --- /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 000000000000..488f57faff3d --- /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 000000000000..1bd7d0c64b88 --- /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 000000000000..0252304ee847 --- /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 000000000000..b7c9f9b029bb --- /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 000000000000..6b67d9bfc1b4 --- /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.collections.Map){ + @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 000000000000..ec5c3ba8eadb --- /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 000000000000..b9506ce766f2 --- /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 000000000000..a26df5946ca7 --- /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 000000000000..1229f89385fe --- /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.mapOf<String, kotlin.Any>, 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 000000000000..ca273d1f3a17 --- /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 000000000000..b46a1fbeded7 --- /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 000000000000..8246390507ec --- /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 000000000000..1c2c521eaf57 --- /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 000000000000..12c2b0a94aa3 --- /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 000000000000..c2ac6a4a936d --- /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 000000000000..3066cfbae73d --- /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 000000000000..d36717d56f71 --- /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 000000000000..5dff54dc190a --- /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 000000000000..ecdce7f408fb --- /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 000000000000..f67aa3c948b6 --- /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 000000000000..04ca19143287 --- /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 000000000000..24b8c5d47ac2 --- /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 000000000000..7484ee590a38 --- /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 000000000000..b5d898602c2c --- /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 000000000000..3738c4b9c91f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/README.md @@ -0,0 +1,167 @@ +# 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* | [**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 + + +### 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 000000000000..9f83d5b1d793 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/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-rx2/docs/200Response.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/200Response.md new file mode 100644 index 000000000000..53c1edacfb84 --- /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 000000000000..1025301ce946 --- /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 000000000000..5ce5a4972c8c --- /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 000000000000..55d482238db4 --- /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 000000000000..6b4c6bf27795 --- /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 000000000000..23a475664205 --- /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 000000000000..b115a5d54c22 --- /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 000000000000..aa0bbbe936c1 --- /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 000000000000..9d44a82fb7ff --- /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 000000000000..b6da7c47cedd --- /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 000000000000..fb8883197a18 --- /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 000000000000..1f12c3eb1582 --- /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 000000000000..50ad61b51a56 --- /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 000000000000..11afbcf0c9f5 --- /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 000000000000..784be537594d --- /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 000000000000..41d9c6ba0d17 --- /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 000000000000..6b14d5e9147d --- /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 000000000000..719084e5f949 --- /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 000000000000..5ddb262871f9 --- /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 000000000000..f0370049eb3e --- /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 000000000000..6736a3e94e17 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FakeApi.md @@ -0,0 +1,727 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +[**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 + + +# **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 000000000000..962dfd4d2dc2 --- /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 000000000000..089e61862c2a --- /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 000000000000..e3e9918872b3 --- /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 000000000000..0357923c97a5 --- /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 000000000000..ed3e4750f44f --- /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 000000000000..472dc3104571 --- /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 000000000000..2156c70addfe --- /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 000000000000..2a77eecba2b7 --- /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 000000000000..0720925918bf --- /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 000000000000..4ca6979b2806 --- /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 000000000000..03c4daa76318 --- /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 000000000000..c3c020b20f60 --- /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 000000000000..afdd81b1383e --- /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 000000000000..13a09a4c4141 --- /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 000000000000..8cee39e36048 --- /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 000000000000..744567412172 --- /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 000000000000..343700533c72 --- /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 000000000000..9ec43d0b87c6 --- /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 000000000000..41e8b82470bc --- /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 000000000000..5112f08958d5 --- /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 000000000000..5296703674de --- /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 000000000000..9e7ecb9499a4 --- /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 000000000000..821d297a001b --- /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 000000000000..b40f6e4b7ef9 --- /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 000000000000..c2fb3ee41d7a --- /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 000000000000..70c340005d16 --- /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 000000000000..576d2f04ca85 --- /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 000000000000..825f613f0907 --- /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 000000000000..a5437240dc32 --- /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 000000000000..282649449d96 --- /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 000000000000..55bd8afdbc09 --- /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 000000000000..60ce1bcdbad3 --- /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 000000000000..e801729b5ed1 --- /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 000000000000..dbf78e81eb22 --- /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 000000000000..b3f1b1a7bbed --- /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 000000000000..5b8c55b19d48 --- /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 okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import io.reactivex.Single +import io.reactivex.Completable +import retrofit2.http.* + +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 000000000000..2028e5de6814 --- /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 okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import io.reactivex.Single +import io.reactivex.Completable +import retrofit2.http.* + +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 000000000000..92028c5f35f7 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt @@ -0,0 +1,63 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import io.reactivex.Single +import io.reactivex.Completable +import retrofit2.http.* + +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.User + +interface FakeApi { + @GET("/fake/health") + fun fakeHealthGet(): Single + + @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 000000000000..5e777ae4c520 --- /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 okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import io.reactivex.Single +import io.reactivex.Completable +import retrofit2.http.* + +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 000000000000..bdb9949fe9b0 --- /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 okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import io.reactivex.Single +import io.reactivex.Completable +import retrofit2.http.* + +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 000000000000..f282f8f7e74c --- /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 okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import io.reactivex.Single +import io.reactivex.Completable +import retrofit2.http.* + +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 000000000000..49a483323e46 --- /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 okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import io.reactivex.Single +import io.reactivex.Completable +import retrofit2.http.* + +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 000000000000..085d78c72a53 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/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-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 000000000000..6120b081929d --- /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 000000000000..001e99325d2e --- /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 000000000000..c5d330ac0757 --- /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 000000000000..30ef6697183a --- /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 000000000000..3ad781c66ca1 --- /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 000000000000..e615135c9cc0 --- /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 000000000000..6465f1485531 --- /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 000000000000..6d216739f0b2 --- /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 000000000000..3dc523271960 --- /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 + } + + @SerializedName("className") + val className: kotlin.String + @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 000000000000..15ea8f6ce57a --- /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 000000000000..02723cb9dcd9 --- /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 000000000000..afde31b7ff41 --- /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 000000000000..d9946e24ba46 --- /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 000000000000..a7c7d3c9a761 --- /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 000000000000..3c0b6063ce16 --- /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 000000000000..7b42c1e2f515 --- /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 000000000000..eddd17dc0231 --- /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 000000000000..d4ca6d612415 --- /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 000000000000..2823f40b88b5 --- /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 000000000000..fbc06cf1dd61 --- /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 000000000000..c422756a65fa --- /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 000000000000..6e5bcb295e11 --- /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 000000000000..2eccf5d72fa7 --- /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 000000000000..6651549b729e --- /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 000000000000..8ccd536e097a --- /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 000000000000..eac43b985250 --- /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 000000000000..f8f4fd031287 --- /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 000000000000..e70f33609981 --- /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 000000000000..5ea4977b7cb5 --- /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 000000000000..e513221c62ba --- /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 000000000000..183929c471fe --- /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 000000000000..b6a6daa80617 --- /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 000000000000..a5734ebed46d --- /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 000000000000..488f57faff3d --- /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 000000000000..1bd7d0c64b88 --- /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 000000000000..0252304ee847 --- /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 000000000000..b7c9f9b029bb --- /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 000000000000..6b67d9bfc1b4 --- /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.collections.Map){ + @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 000000000000..ec5c3ba8eadb --- /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 000000000000..b9506ce766f2 --- /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 000000000000..a26df5946ca7 --- /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 000000000000..1229f89385fe --- /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.mapOf<String, kotlin.Any>, 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 000000000000..ca273d1f3a17 --- /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 000000000000..b46a1fbeded7 --- /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 000000000000..8246390507ec --- /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 000000000000..1c2c521eaf57 --- /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 000000000000..12c2b0a94aa3 --- /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 000000000000..c2ac6a4a936d --- /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 000000000000..3066cfbae73d --- /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 000000000000..d36717d56f71 --- /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 000000000000..5dff54dc190a --- /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 000000000000..ecdce7f408fb --- /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 000000000000..f67aa3c948b6 --- /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 000000000000..04ca19143287 --- /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 000000000000..24b8c5d47ac2 --- /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 + } + +} + From 8b074f44a0413b14a5a100cd36103a445b8d65e4 Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Mon, 30 Mar 2020 18:59:33 +0300 Subject: [PATCH 03/32] Fixed generating retrofit2 without Rx/Coroutines --- .../languages/KotlinClientCodegen.java | 56 +++++++++++++------ .../libraries/jvm-retrofit2/api.mustache | 10 ++-- 2 files changed, 45 insertions(+), 21 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java index 466668c5e483..cd80b05410bb 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java @@ -49,8 +49,8 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { public static final String USE_RX_JAVA = "useRxJava"; public static final String USE_RX_JAVA2 = "useRxJava2"; - public static final String DO_NOT_USE_RX = "doNotUseRx"; 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"; @@ -63,10 +63,10 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { 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 = false; - protected boolean useCoroutines = true; + protected boolean doNotUseRxAndCoroutines = true; public enum DateLibrary { STRING("string"), @@ -210,17 +210,21 @@ public String getHelp() { } public void setUseRxJava(boolean useRxJava) { + if (useRxJava) { + this.useRxJava2 = false; + this.doNotUseRxAndCoroutines = false; + this.useCoroutines = false; + } this.useRxJava = useRxJava; - this.useRxJava2 = false; - this.doNotUseRxAndCoroutines = false; - this.useCoroutines = false; } public void setUseRxJava2(boolean useRxJava2) { + if (useRxJava2) { + this.useRxJava = false; + this.doNotUseRxAndCoroutines = false; + this.useCoroutines = false; + } this.useRxJava2 = useRxJava2; - this.useRxJava = false; - this.doNotUseRxAndCoroutines = false; - this.useCoroutines = false; } public void setDoNotUseRxAndCoroutines(boolean doNotUseRxAndCoroutines) { @@ -262,18 +266,36 @@ public void processOpts() { sourceFolder = "src/commonMain/kotlin"; } - // RxJava - if (additionalProperties.containsKey(USE_RX_JAVA) && additionalProperties.containsKey(USE_RX_JAVA2)) { - LOGGER.warn("You specified both RxJava versions 1 and 2 but they are mutually exclusive. Defaulting to v2."); - } else if (additionalProperties.containsKey(USE_RX_JAVA)) { - this.setUseRxJava(Boolean.valueOf(additionalProperties.get(USE_RX_JAVA).toString())); + + 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 (additionalProperties.containsKey(USE_RX_JAVA2)) { + 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 (!useRxJava && !useRxJava2 && !useCoroutines) { - additionalProperties.put(DO_NOT_USE_RX, true); + if (!hasRx && !hasRx2 && !hasCoroutines) { + setDoNotUseRxAndCoroutines(true); + additionalProperties.put(DO_NOT_USE_RX_AND_COROUTINES, true); } // infrastructure destination folder 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 a55be6ae43c8..a234280b9da0 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 @@ -1,9 +1,14 @@ 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}} @@ -15,10 +20,7 @@ import io.reactivex.Single import io.reactivex.Completable {{/useRxJava2}} {{/returnType}} -{{#doNotUseRxAndCoroutines}} -import retrofit2.Call {{/doNotUseRxAndCoroutines}} -import retrofit2.http.* {{#imports}}import {{import}} {{/imports}} @@ -44,7 +46,7 @@ interface {{classname}} { {{/prioritizedContentTypes}} {{/formParams}} @{{httpMethod}}("{{{path}}}") - {{#useCoroutines}}suspend {{/useCoroutines}}fun {{operationId}}({{^allParams}}){{/allParams}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}}, {{/hasMore}}{{^hasMore}}){{/hasMore}}{{/allParams}}: {{^doNotUseRxAndCoroutines}}{{#useRxJava}}Single<{{#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}}{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}}{{/isResponseFile}}{{/doNotUseRxAndCoroutines}} + {{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}({{^allParams}}){{/allParams}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}}, {{/hasMore}}{{^hasMore}}){{/hasMore}}{{/allParams}}: {{^doNotUseRxAndCoroutines}}{{#useRxJava}}Single<{{#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}} } From 87745a9bddd5595d7d5aa0ab9e45aeaf8205e77a Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Mon, 30 Mar 2020 19:00:47 +0300 Subject: [PATCH 04/32] Fixed MultipartBody template, remove redundant space after MultipartBody.Part annotation --- .../kotlin-client/libraries/jvm-retrofit2/formParams.mustache | 2 +- .../src/main/kotlin/org/openapitools/client/apis/PetApi.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 2fc767cb2cfd..d5267aa77462 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/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 75f3323445cc..e0257edb0f49 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 } From 22f96f84948992b42efbad8f2ff378bbfc7e9de4 Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Thu, 2 Apr 2020 13:01:04 +0300 Subject: [PATCH 05/32] Fix documentation diff. --- docs/generators/kotlin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index 616fe86102af..f9903f9c7d7a 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -24,7 +24,7 @@ sidebar_label: kotlin |sourceFolder|source folder for generated code| |src/main/kotlin| |useRxJava|Whether to use the RxJava adapter with the retrofit2 library.| |false| |useRxJava2|Whether to use the RxJava2 adapter with the retrofit2 library.| |false| -|useCoroutines|Whether to use the Coroutines adapter with the retrofit2 library.| |true| +|useCoroutines|Whether to use the Coroutines adapter with the retrofit2 library.| |false| ## IMPORT MAPPING From 602ae5a0f1e49381c013caa119904ef0f10c2c22 Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Thu, 2 Apr 2020 16:01:34 +0300 Subject: [PATCH 06/32] Fix generating build.gradle file for samples. Add dependencies for rxJava/rxJava2 and rx retrofit's adapter. --- .../resources/kotlin-client/build.gradle.mustache | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 82a624d47005..b5481b716305 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" From 8e5434b1eb01027f51ae30f50b564a62c2c62878 Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Thu, 2 Apr 2020 16:26:43 +0300 Subject: [PATCH 07/32] Update generated sample with rx dependencies --- .../client/petstore/kotlin-jvm-retrofit2-rx2/build.gradle | 3 +++ .../kotlin/org/openapitools/client/apis/AnotherFakeApi.kt | 2 +- .../main/kotlin/org/openapitools/client/apis/DefaultApi.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/FakeApi.kt | 4 ++-- .../org/openapitools/client/apis/FakeClassnameTags123Api.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/PetApi.kt | 6 +++--- .../main/kotlin/org/openapitools/client/apis/StoreApi.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/UserApi.kt | 2 +- .../main/kotlin/org/openapitools/client/models/MapTest.kt | 2 +- 9 files changed, 14 insertions(+), 11 deletions(-) diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/build.gradle b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/build.gradle index 9f83d5b1d793..34fcb2feb463 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/build.gradle +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/build.gradle @@ -9,6 +9,7 @@ wrapper { 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" } @@ -31,6 +32,8 @@ test { 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" 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 index 5b8c55b19d48..fe39014a4283 100644 --- 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 @@ -1,12 +1,12 @@ 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 retrofit2.http.* import org.openapitools.client.models.Client 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 index 2028e5de6814..9fc3353c5c9d 100644 --- 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 @@ -1,12 +1,12 @@ 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 retrofit2.http.* import org.openapitools.client.models.InlineResponseDefault 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 index 92028c5f35f7..1de244afb0fd 100644 --- 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 @@ -1,12 +1,12 @@ 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 retrofit2.http.* import org.openapitools.client.models.Client import org.openapitools.client.models.FileSchemaTestClass @@ -41,7 +41,7 @@ interface FakeApi { @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 + 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") 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 index 5e777ae4c520..1c6fef550666 100644 --- 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 @@ -1,12 +1,12 @@ 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 retrofit2.http.* import org.openapitools.client.models.Client 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 index bdb9949fe9b0..078de4d6c92f 100644 --- 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 @@ -1,12 +1,12 @@ 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 retrofit2.http.* import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet @@ -37,10 +37,10 @@ interface PetApi { @Multipart @POST("/pet/{petId}/uploadImage") - fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String, @Part file: MultipartBody.Part ): Single + 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 + 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 index f282f8f7e74c..2e877fc382c1 100644 --- 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 @@ -1,12 +1,12 @@ 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 retrofit2.http.* import org.openapitools.client.models.Order 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 index 49a483323e46..2c1d45116e39 100644 --- 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 @@ -1,12 +1,12 @@ 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 retrofit2.http.* import org.openapitools.client.models.User 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 index 6b67d9bfc1b4..deb012634aa2 100644 --- 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 @@ -41,7 +41,7 @@ data class MapTest ( * Values: uPPER,lower */ - enum class MapOfEnumString(val value: kotlin.collections.Map){ + enum class MapOfEnumString(val value: kotlin.String){ @SerializedName(value="UPPER") uPPER("UPPER"), @SerializedName(value="lower") lower("lower"); } From d6b568d9a8d01a059d41ac210af2b995d5cdb92d Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Thu, 2 Apr 2020 16:29:09 +0300 Subject: [PATCH 08/32] Update generated sample with coroutines --- .../kotlin/org/openapitools/client/apis/AnotherFakeApi.kt | 2 +- .../main/kotlin/org/openapitools/client/apis/DefaultApi.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/FakeApi.kt | 4 ++-- .../org/openapitools/client/apis/FakeClassnameTags123Api.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/PetApi.kt | 6 +++--- .../main/kotlin/org/openapitools/client/apis/StoreApi.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/UserApi.kt | 2 +- .../main/kotlin/org/openapitools/client/models/MapTest.kt | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) 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 index 21443c59b017..af9af8a9f2dd 100644 --- 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 @@ -1,10 +1,10 @@ package org.openapitools.client.apis import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* import okhttp3.RequestBody import okhttp3.ResponseBody import okhttp3.MultipartBody -import retrofit2.http.* import org.openapitools.client.models.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 index f09a149e8cf1..74104da77ca4 100644 --- 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 @@ -1,10 +1,10 @@ package org.openapitools.client.apis import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* import okhttp3.RequestBody import okhttp3.ResponseBody import okhttp3.MultipartBody -import retrofit2.http.* import org.openapitools.client.models.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 index e27da1d7eb55..25a44f768b29 100644 --- 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 @@ -1,10 +1,10 @@ package org.openapitools.client.apis import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* import okhttp3.RequestBody import okhttp3.ResponseBody import okhttp3.MultipartBody -import retrofit2.http.* import org.openapitools.client.models.Client import org.openapitools.client.models.FileSchemaTestClass @@ -39,7 +39,7 @@ interface FakeApi { @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 + 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") 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 index 01004f1dc880..12d94ffec19b 100644 --- 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 @@ -1,10 +1,10 @@ package org.openapitools.client.apis import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* import okhttp3.RequestBody import okhttp3.ResponseBody import okhttp3.MultipartBody -import retrofit2.http.* import org.openapitools.client.models.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 index 155d7fb21bda..9c0ceaaef457 100644 --- 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 @@ -1,10 +1,10 @@ package org.openapitools.client.apis import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* import okhttp3.RequestBody import okhttp3.ResponseBody import okhttp3.MultipartBody -import retrofit2.http.* import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet @@ -35,10 +35,10 @@ interface PetApi { @Multipart @POST("/pet/{petId}/uploadImage") - suspend fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String, @Part file: MultipartBody.Part ): ApiResponse + 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 + 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 index e30127a6ac36..8d434e5589e7 100644 --- 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 @@ -1,10 +1,10 @@ package org.openapitools.client.apis import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* import okhttp3.RequestBody import okhttp3.ResponseBody import okhttp3.MultipartBody -import retrofit2.http.* import org.openapitools.client.models.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 index 2badde6de5d0..88ba45486a42 100644 --- 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 @@ -1,10 +1,10 @@ package org.openapitools.client.apis import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* import okhttp3.RequestBody import okhttp3.ResponseBody import okhttp3.MultipartBody -import retrofit2.http.* import org.openapitools.client.models.User 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 index 6b67d9bfc1b4..deb012634aa2 100644 --- 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 @@ -41,7 +41,7 @@ data class MapTest ( * Values: uPPER,lower */ - enum class MapOfEnumString(val value: kotlin.collections.Map){ + enum class MapOfEnumString(val value: kotlin.String){ @SerializedName(value="UPPER") uPPER("UPPER"), @SerializedName(value="lower") lower("lower"); } From cd40923a68f0026be0a85eeea1662c038e7b0bee Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Thu, 2 Apr 2020 16:29:31 +0300 Subject: [PATCH 09/32] Update generated sample with RxJava 2 dependencies --- .../client/petstore/kotlin-jvm-retrofit2-rx/build.gradle | 3 +++ .../kotlin/org/openapitools/client/apis/AnotherFakeApi.kt | 2 +- .../main/kotlin/org/openapitools/client/apis/DefaultApi.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/FakeApi.kt | 4 ++-- .../org/openapitools/client/apis/FakeClassnameTags123Api.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/PetApi.kt | 6 +++--- .../main/kotlin/org/openapitools/client/apis/StoreApi.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/UserApi.kt | 2 +- .../main/kotlin/org/openapitools/client/models/MapTest.kt | 2 +- 9 files changed, 14 insertions(+), 11 deletions(-) diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/build.gradle b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/build.gradle index 9f83d5b1d793..94e4916b6dfd 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/build.gradle +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/build.gradle @@ -9,6 +9,7 @@ wrapper { 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" } @@ -31,6 +32,8 @@ test { 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" 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 index 9d438d7511e8..5ac288137bf3 100644 --- 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 @@ -1,11 +1,11 @@ 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 retrofit2.http.* import org.openapitools.client.models.Client 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 index 58bbd5fd41c9..9ddc7166ffb7 100644 --- 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 @@ -1,11 +1,11 @@ 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 retrofit2.http.* import org.openapitools.client.models.InlineResponseDefault 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 index 9f0dfb5e1f05..e547317dec5c 100644 --- 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 @@ -1,11 +1,11 @@ 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 retrofit2.http.* import org.openapitools.client.models.Client import org.openapitools.client.models.FileSchemaTestClass @@ -40,7 +40,7 @@ interface FakeApi { @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): Single + 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): Single @FormUrlEncoded @GET("/fake") 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 index ee2d08f00e3d..848082fca24e 100644 --- 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 @@ -1,11 +1,11 @@ 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 retrofit2.http.* import org.openapitools.client.models.Client 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 index 1bc5438e53d9..8cafc145ecf3 100644 --- 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 @@ -1,11 +1,11 @@ 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 retrofit2.http.* import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet @@ -36,10 +36,10 @@ interface PetApi { @Multipart @POST("/pet/{petId}/uploadImage") - fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String, @Part file: MultipartBody.Part ): Single + 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 + 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-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 index 01c2aee46b23..281d2fd5f94a 100644 --- 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 @@ -1,11 +1,11 @@ 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 retrofit2.http.* import org.openapitools.client.models.Order 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 index 2ac3f5c423b3..73c0386ddbad 100644 --- 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 @@ -1,11 +1,11 @@ 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 retrofit2.http.* import org.openapitools.client.models.User 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 index 6b67d9bfc1b4..deb012634aa2 100644 --- 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 @@ -41,7 +41,7 @@ data class MapTest ( * Values: uPPER,lower */ - enum class MapOfEnumString(val value: kotlin.collections.Map){ + enum class MapOfEnumString(val value: kotlin.String){ @SerializedName(value="UPPER") uPPER("UPPER"), @SerializedName(value="lower") lower("lower"); } From 42b0abb4369b97de53ee41ec60c121bd58fdd81f Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Thu, 2 Apr 2020 17:19:11 +0300 Subject: [PATCH 10/32] Update and refactoring scripts for sample generation --- bin/openapi3/kotlin-client-petstore-all.sh | 10 ++++++++++ bin/openapi3/kotlin-client-petstore-multiplatform.sh | 8 +++++--- .../kotlin-client-petstore-nullable-required.sh | 8 +++++--- .../kotlin-client-petstore-retrofit2-coroutines.sh | 8 +++++--- bin/openapi3/kotlin-client-petstore-retrofit2-rx.sh | 8 +++++--- bin/openapi3/kotlin-client-petstore-retrofit2-rx2.sh | 8 +++++--- bin/openapi3/kotlin-client-petstore.sh | 8 +++++--- 7 files changed, 40 insertions(+), 18 deletions(-) create mode 100755 bin/openapi3/kotlin-client-petstore-all.sh diff --git a/bin/openapi3/kotlin-client-petstore-all.sh b/bin/openapi3/kotlin-client-petstore-all.sh new file mode 100755 index 000000000000..5be9f089bf28 --- /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 913f73ef1d85..9ea035839446 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 +samplePath="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 samples/openapi3/client/petstore/kotlin-multiplatform $@" +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 samples/openapi3/client/petstore/kotlin-multiplatform" -rm -rf samples/openapi3/client/petstore/kotlin-multiplatform +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 18c09a54cacd..a59f31ecb542 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 +samplePath="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 samples/openapi3/client/petstore/kotlin-nullable-required $@" +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 samples/openapi3/client/petstore/kotlin-nullable-required" -rm -rf samples/openapi3/client/petstore/kotlin-nullable-required +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 index bd5737588c26..0c45c5584df1 100755 --- a/bin/openapi3/kotlin-client-petstore-retrofit2-coroutines.sh +++ b/bin/openapi3/kotlin-client-petstore-retrofit2-coroutines.sh @@ -25,11 +25,13 @@ 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-rx2-client --library jvm-retrofit2 --additional-properties serializationLibrary=gson,dateLibrary=java8,serializableModel=true,useCoroutines=true -o samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines $@" +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 samples/openapi3/client/petstore/kotlin" -rm -rf samples/openapi3/client/petstore/kotlin +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 index 9ac3fcee9ec5..6d97bd8de72e 100755 --- a/bin/openapi3/kotlin-client-petstore-retrofit2-rx.sh +++ b/bin/openapi3/kotlin-client-petstore-retrofit2-rx.sh @@ -25,11 +25,13 @@ 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-rx2-client --library jvm-retrofit2 --additional-properties serializationLibrary=gson,dateLibrary=java8,serializableModel=true,useRxJava=true -o samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx $@" +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 samples/openapi3/client/petstore/kotlin" -rm -rf samples/openapi3/client/petstore/kotlin +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 index 6700e1bd3dc6..d6265f8fea98 100755 --- a/bin/openapi3/kotlin-client-petstore-retrofit2-rx2.sh +++ b/bin/openapi3/kotlin-client-petstore-retrofit2-rx2.sh @@ -25,11 +25,13 @@ 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 samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2 $@" +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 samples/openapi3/client/petstore/kotlin" -rm -rf samples/openapi3/client/petstore/kotlin +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 d03522768005..a36d42599bef 100755 --- a/bin/openapi3/kotlin-client-petstore.sh +++ b/bin/openapi3/kotlin-client-petstore.sh @@ -25,11 +25,13 @@ then mvn clean package fi +samplePath="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 samples/openapi3/client/petstore/kotlin $@" +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 samples/openapi3/client/petstore/kotlin" -rm -rf samples/openapi3/client/petstore/kotlin +echo "Cleaning previously generated files if any from $samplePath" +rm -rf $samplePath echo "Generating Kotling client..." java $JAVA_OPTS -jar $executable $ags From 7f91ea8c86ecb1cab8704c9a676bb1893ab84ed2 Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Thu, 2 Apr 2020 17:21:23 +0300 Subject: [PATCH 11/32] Update generated sample code --- .../settings.gradle | 2 +- .../kotlin-jvm-retrofit2-rx/settings.gradle | 2 +- .../.openapi-generator/VERSION | 2 +- .../kotlin-multiplatform/docs/Category.md | 2 +- .../kotlin-multiplatform/docs/EnumTest.md | 14 +- .../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 +- .../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 | 18 +- .../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 +- .../client/petstore/kotlin/build.gradle | 14 +- .../client/petstore/kotlin/docs/Category.md | 2 +- .../client/petstore/kotlin/docs/EnumTest.md | 14 +- .../client/petstore/kotlin/docs/FakeApi.md | 4 +- .../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 | 302 +++++++++++++----- .../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 | 20 +- .../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 +- 132 files changed, 1083 insertions(+), 663 deletions(-) create mode 100644 samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/settings.gradle b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/settings.gradle index b3f1b1a7bbed..94448508bc50 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/settings.gradle +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/settings.gradle @@ -1,2 +1,2 @@ -rootProject.name = 'kotlin-petstore-rx2-client' \ No newline at end of file +rootProject.name = 'kotlin-petstore-coroutines-client' \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/settings.gradle b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/settings.gradle index b3f1b1a7bbed..06f03c0c4137 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/settings.gradle +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/settings.gradle @@ -1,2 +1,2 @@ -rootProject.name = 'kotlin-petstore-rx2-client' \ No newline at end of file +rootProject.name = 'kotlin-petstore-rx-client' \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION b/samples/openapi3/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION index c3a2c7076fa8..b5d898602c2c 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/docs/Category.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Category.md index 92c9e2243d65..1f12c3eb1582 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 bdef500a433d..f0370049eb3e 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,18 +14,18 @@ Name | Type | Description | Notes **outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] - -## Enum: enum_string + +## Enum: enum_string_required Name | Value ---- | ----- -enumString | UPPER, lower, +enumStringRequired | UPPER, lower, - -## Enum: enum_string_required + +## Enum: enum_string Name | Value ---- | ----- -enumStringRequired | UPPER, lower, +enumString | UPPER, lower, diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FormatTest.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FormatTest.md index 7f3aec255b48..080b13c2d8eb 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 92279bc2976b..450e7d530586 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 fd2cee485c1d..47d904d8e2ac 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 36a1d460467c..8cee39e36048 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 ec7756007379..70c340005d16 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/models/AdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt index 3ea85247a2f1..ecc2051d2c70 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt @@ -23,7 +23,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer data class AdditionalPropertiesClass ( @SerialName(value = "map_property") val mapProperty: kotlin.collections.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 a4a0aedb9da0..9fe4ece02dd5 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 eadb9198bd6d..805244a3762e 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 af74669d8969..587082fae3d0 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 d495abee8ef4..205c7e725e26 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 cc1e251cbbf3..e4d9e1040627 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 be08fe9356be..e960d48879e7 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 d49347068222..42c192b93028 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 daa6ccbd65be..d7a72badbcdf 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 c260a3d2cf12..6fb58ac646ed 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 5944f0f4f0f9..c4ea808d23a5 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 a7e37fa2d360..30d316bd7064 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 c9dada258917..360f985d7553 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 335066a664c9..6e18a5729e29 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 24712541204c..b9598fb80a56 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 5028c4e1656d..56dd36107415 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 e8118469105a..4f1a77e06b94 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,33 +39,31 @@ 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){ + @Serializable(with = EnumStringRequired.Serializer::class) + enum class EnumStringRequired(val value: kotlin.String){ uPPER("UPPER"), lower("lower"), eMPTY(""); - object Serializer : CommonEnumSerializer("EnumString", values(), values().map { it.value.toString() }.toTypedArray()) + object Serializer : CommonEnumSerializer("EnumStringRequired", values(), values().map { it.value.toString() }.toTypedArray()) } /** * * Values: uPPER,lower,eMPTY */ - @Serializable(with = EnumStringRequired.Serializer::class) - enum class EnumStringRequired(val value: kotlin.String){ + @Serializable(with = EnumString.Serializer::class) + enum class EnumString(val value: kotlin.String){ uPPER("UPPER"), lower("lower"), eMPTY(""); - object Serializer : CommonEnumSerializer("EnumStringRequired", values(), values().map { it.value.toString() }.toTypedArray()) + object Serializer : CommonEnumSerializer("EnumString", values(), values().map { it.value.toString() }.toTypedArray()) } /** * 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 f33eeffe62e6..4d09277f9537 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 16666d74e543..f208e3add1d1 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 728b0d485a7d..1d87f25126d8 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 42e50350bbe6..617c8a98b847 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 25c1eb1a2a04..6524d535ce07 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 f16618c66fbf..787f859549fa 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 8a8f4b48eb67..bf299be4274e 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 b43c611730f3..2f9e4da97844 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 a85b872c57ef..62e5c16b0900 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 cd4cb2cd7001..4a1f2f2ecc5e 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 39d77eeb5706..d7a7bd0ecce6 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 8bcddc6c1b7d..425640579467 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 3b63af8f2a4c..2768b1935d41 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 e376dc68237b..eff239dcfb33 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 20923138ee2a..73b632b52a6a 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 2090e911b9ca..719b2bd7d25b 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 3a720f71d4ee..e010f6a7028f 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 a325662a355c..2c86c8921ada 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.mapOf<String, kotlin.String> 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 b8a3f824f9e3..28a3ce64289e 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 daf7ab61d12a..166b38626821 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 5eb2ff16e169..ab7d6bf2a6f4 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 7d03994603a6..4d7279546667 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 e819231a3730..d818ad3a459e 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 0f73f3da8c4d..19973003776f 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 497d8f1b12ca..a46a90efb071 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 bca3e142602d..46c476209ad3 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 77e15e87cf7d..4d99ea7a9a2c 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 a6f2bf313c91..c4e80831628b 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 eb395fbe5706..20dd7ada2799 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 d0b206966f18..0b3f202ad517 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 71d86c975ff1..47ad0a9f2829 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 c3a2c7076fa8..b5d898602c2c 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/build.gradle b/samples/openapi3/client/petstore/kotlin/build.gradle index 98ac4f243e6f..56be0bd0dd87 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 92c9e2243d65..1f12c3eb1582 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 bdef500a433d..f0370049eb3e 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,18 +14,18 @@ Name | Type | Description | Notes **outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] - -## Enum: enum_string + +## Enum: enum_string_required Name | Value ---- | ----- -enumString | UPPER, lower, +enumStringRequired | UPPER, lower, - -## Enum: enum_string_required + +## Enum: enum_string Name | Value ---- | ----- -enumStringRequired | UPPER, lower, +enumString | UPPER, lower, diff --git a/samples/openapi3/client/petstore/kotlin/docs/FakeApi.md b/samples/openapi3/client/petstore/kotlin/docs/FakeApi.md index afacd58744b1..6736a3e94e17 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/kotlin/docs/FakeApi.md @@ -414,7 +414,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 +443,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 9a339982e00b..0357923c97a5 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 e709b0e1b89a..4ca6979b2806 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 2eac39437594..c3c020b20f60 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 36a1d460467c..8cee39e36048 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 293d9cc69f77..744567412172 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 6b15b13fc9b3..9ec43d0b87c6 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 ef31dbf2f4f4..5112f08958d5 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 ec7756007379..70c340005d16 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 d72e5dbdab05..ed16413ba9cc 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 6715f892def1..25a92f753483 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 55e337e9ac99..9586f53f8d68 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 @@ -29,14 +29,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 +57,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 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) + } } } @@ -66,8 +82,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 +98,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 +123,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 +139,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 +164,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 +180,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 +205,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 +221,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 +246,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 +261,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 +287,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 +305,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 +330,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 +346,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 +384,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 +431,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 +490,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 +515,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 +540,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 +555,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 +581,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 +625,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 +647,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 b29b2d2d4dc0..0145742af683 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 76c993796ef8..b5d5deca904d 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 260158983efb..ba702612083e 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 60c866409757..6e05b135cd3d 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 d5f717b61aad..d3ca9efeadca 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 f1a8aecc914b..9dc8d8dbbfaa 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 617ac3fe9069..ff5e2a81ee8c 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 2f3b0157ba70..b5310e71f13c 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 000000000000..87437871a31e --- /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 7c5a353e0f7f..697559b2ec16 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 fe775011a956..1c3490006341 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 188e1ddc7085..6e1d0820cc9c 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 6df7feef3d9e..0a13c7737ed6 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 7a302b510f43..05ea7ceb7c8b 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 f8b5404b7e15..50a185a83e77 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 1831ecc889a0..9a9802727205 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 c478ffe91803..fb29c1748585 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 48c9727de07e..4fcd2af6a6f5 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 37bc7add21fb..a40140de8413 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 61dc86df2186..fe0d03dce811 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 17228f01f48d..fe0639b7fb19 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 c0f91b21a9db..201d4bbbd720 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 22414a0efd16..5ffd15879f8c 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 086ee4c6a0d3..019476d4f631 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 2de4461719f0..8d9076e627fa 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 db8cf07dd99c..8bd3f24f8295 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 2732b2462492..f2b499dedfc9 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,19 +47,17 @@ 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){ + enum class EnumStringRequired(val value: kotlin.String){ @Json(name = "UPPER") uPPER("UPPER"), @Json(name = "lower") lower("lower"), @Json(name = "") eMPTY(""); @@ -69,7 +67,7 @@ data class EnumTest ( * Values: uPPER,lower,eMPTY */ - enum class EnumStringRequired(val value: kotlin.String){ + enum class EnumString(val value: kotlin.String){ @Json(name = "UPPER") uPPER("UPPER"), @Json(name = "lower") lower("lower"), @Json(name = "") eMPTY(""); @@ -80,8 +78,8 @@ data class EnumTest ( */ 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 7deb80853b36..877c970780fd 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 57925fce832a..34baa08bfa04 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 2b587f520d2d..5820c2f7b42b 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 949cb4e5b806..e3a09f94c965 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 57c37e9dc609..ad7cfc23b6a6 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 91689261680e..70ac28e3d533 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 7e996c6a4fc3..72806f05c967 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 bf0980c7228c..43f87364d31b 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 aacdc7583fc0..142b9b788d14 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 58674757a7ba..b380c4ce723e 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 0c7c601bd7da..80b8a1788f28 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 de26c4e00b41..d78338d8a8f6 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 c24ed15deacd..7840b6090391 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 376cc143cd70..d3eae1e85ab9 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 21d8a0981019..44844b5d0132 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 542405de963d..3c92defc46b5 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 99df32389af7..544fdcc91aa4 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 afc8d24463fc..41691e8fe8a5 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.mapOf<String, kotlin.Any>, 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 15c8dfdcf56e..3bc4389e1cc4 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 b6754577938a..a4e0ad8f52de 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 2d2fd9b1c6d1..c22ad0b5f8fc 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 86ce0b25a147..6c5d370c87c4 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 bf9e3e79960e..f1c4a8624345 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 c7345e41ebe2..b8f161d126bd 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 f8435385ea38..97c15f39a2c0 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 b8795d4ab537..389a15cf692b 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 7265237f9b13..ac09dd089e08 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 4ee2459c1cf3..1d2dd5ac1e97 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 2f1e0dea5a4e..731a3b05e834 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 13667abe035f..6d999d38576a 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 4443da984dff..fbe6650a9141 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 } + } From 7966a4c38a86fa065a7b040494c9a1c1760fc959 Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Thu, 2 Apr 2020 17:35:47 +0300 Subject: [PATCH 12/32] revert changes by mistake --- bin/ci/kotlin-client-petstore-coroutines.json | 12 ------------ bin/ci/kotlin-client-petstore-rx.json | 12 ------------ bin/ci/kotlin-client-petstore-rx2.json | 12 ------------ bin/kotlin-client-all.sh | 3 --- 4 files changed, 39 deletions(-) delete mode 100644 bin/ci/kotlin-client-petstore-coroutines.json delete mode 100644 bin/ci/kotlin-client-petstore-rx.json delete mode 100644 bin/ci/kotlin-client-petstore-rx2.json diff --git a/bin/ci/kotlin-client-petstore-coroutines.json b/bin/ci/kotlin-client-petstore-coroutines.json deleted file mode 100644 index d22cd1de3d04..000000000000 --- a/bin/ci/kotlin-client-petstore-coroutines.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "artifactId": "kotlin-petstore-client", - "generatorName": "kotlin", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/kotlin", - "templateDir": "modules/openapi-generator/src/main/resources/kotlin-client", - "additionalProperties": { - "dateLibrary": "java8", - "serializableModel": "true", - "useCoroutines" : "true" - } -} \ No newline at end of file diff --git a/bin/ci/kotlin-client-petstore-rx.json b/bin/ci/kotlin-client-petstore-rx.json deleted file mode 100644 index 7b640ef6e72e..000000000000 --- a/bin/ci/kotlin-client-petstore-rx.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "artifactId": "kotlin-petstore-client", - "generatorName": "kotlin", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/kotlin", - "templateDir": "modules/openapi-generator/src/main/resources/kotlin-client", - "additionalProperties": { - "dateLibrary": "java8", - "serializableModel": "true", - "useRxJava" : "true" - } -} \ No newline at end of file diff --git a/bin/ci/kotlin-client-petstore-rx2.json b/bin/ci/kotlin-client-petstore-rx2.json deleted file mode 100644 index 542fc2e986bf..000000000000 --- a/bin/ci/kotlin-client-petstore-rx2.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "artifactId": "kotlin-petstore-client", - "generatorName": "kotlin", - "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", - "outputDir": "samples/client/petstore/kotlin", - "templateDir": "modules/openapi-generator/src/main/resources/kotlin-client", - "additionalProperties": { - "dateLibrary": "java8", - "serializableModel": "true", - "useRxJava2" : "true" - } -} \ No newline at end of file diff --git a/bin/kotlin-client-all.sh b/bin/kotlin-client-all.sh index 6374ac10f573..137c6eb5e898 100755 --- a/bin/kotlin-client-all.sh +++ b/bin/kotlin-client-all.sh @@ -7,9 +7,6 @@ ./bin/kotlin-client-okhttp3.sh ./bin/kotlin-client-petstore-multiplatform.sh ./bin/kotlin-client-petstore.sh -./bin/kotlin-client-petstore-retrofit2-coroutines.sh -./bin/kotlin-client-petstore-retrofit2-rx.sh -./bin/kotlin-client-petstore-retrofit2-rx2.sh ./bin/kotlin-client-string.sh ./bin/kotlin-client-threetenbp.sh ./bin/kotlin-client-nullable.sh From 1d442c10dc928dabca7a5c978d2159156cc55725 Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Thu, 2 Apr 2020 17:37:42 +0300 Subject: [PATCH 13/32] revert changes by mistake #2 --- .github/.test/samples.json | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.github/.test/samples.json b/.github/.test/samples.json index 02593e57337e..6a157556aae1 100644 --- a/.github/.test/samples.json +++ b/.github/.test/samples.json @@ -686,24 +686,6 @@ "Client: Kotlin" ] }, - { - "input": "kotlin-client-petstore-retrofit2-coroutines.sh", - "matches": [ - "Client: Kotlin" - ] - }, - { - "input": "kotlin-client-petstore-retrofit2-rx.sh", - "matches": [ - "Client: Kotlin" - ] - }, - { - "input": "kotlin-client-petstore-retrofit2-rx2.sh", - "matches": [ - "Client: Kotlin" - ] - }, { "input": "kotlin-client-string.sh", "matches": [ From f621481159df171fba1a6c1032245272bff8bc23 Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Thu, 2 Apr 2020 20:07:29 +0300 Subject: [PATCH 14/32] Fix return type for first RxJava --- .../kotlin-client/libraries/jvm-retrofit2/api.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 a234280b9da0..4f1a70a501a9 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 @@ -46,7 +46,7 @@ interface {{classname}} { {{/prioritizedContentTypes}} {{/formParams}} @{{httpMethod}}("{{{path}}}") - {{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}({{^allParams}}){{/allParams}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}}, {{/hasMore}}{{^hasMore}}){{/hasMore}}{{/allParams}}: {{^doNotUseRxAndCoroutines}}{{#useRxJava}}Single<{{#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}} + {{^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}} } From 62bac13928eb38599d38404d65c25d2643703b4a Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Thu, 2 Apr 2020 20:12:12 +0300 Subject: [PATCH 15/32] Add RxJavaCallAdapterFactory to ApiClient scheme for RxJava 1/2 --- .../infrastructure/ApiClient.kt.mustache | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 723be88b00a3..71c558c8519a 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}} From 21933ea8b47a631be12c7f6badd9d60930106245 Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Thu, 2 Apr 2020 20:17:16 +0300 Subject: [PATCH 16/32] Fix script loggin --- bin/openapi3/kotlin-client-petstore-retrofit2-rx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/openapi3/kotlin-client-petstore-retrofit2-rx.sh b/bin/openapi3/kotlin-client-petstore-retrofit2-rx.sh index 6d97bd8de72e..fef65a303b20 100755 --- a/bin/openapi3/kotlin-client-petstore-retrofit2-rx.sh +++ b/bin/openapi3/kotlin-client-petstore-retrofit2-rx.sh @@ -30,7 +30,7 @@ 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" +echo "Cleaning previously generated files if any from $samplePath" rm -rf $samplePath echo "Generating Kotling client..." From 670346a249629868c1474ab29a395cf1693922fd Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Thu, 2 Apr 2020 20:18:04 +0300 Subject: [PATCH 17/32] Update generated code for RxJava 1/2 --- .../client/apis/AnotherFakeApi.kt | 2 +- .../openapitools/client/apis/DefaultApi.kt | 2 +- .../org/openapitools/client/apis/FakeApi.kt | 28 +++++++++---------- .../client/apis/FakeClassnameTags123Api.kt | 2 +- .../org/openapitools/client/apis/PetApi.kt | 18 ++++++------ .../org/openapitools/client/apis/StoreApi.kt | 8 +++--- .../org/openapitools/client/apis/UserApi.kt | 16 +++++------ .../client/infrastructure/ApiClient.kt | 2 ++ .../client/infrastructure/ApiClient.kt | 2 ++ 9 files changed, 42 insertions(+), 38 deletions(-) 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 index 5ac288137bf3..8814c97b6b42 100644 --- 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 @@ -11,6 +11,6 @@ import org.openapitools.client.models.Client interface AnotherFakeApi { @PATCH("/another-fake/dummy") - fun call123testSpecialTags(@Body client: Client): Single + 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 index 9ddc7166ffb7..a7cc4c43ea6c 100644 --- 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 @@ -11,6 +11,6 @@ import org.openapitools.client.models.InlineResponseDefault interface DefaultApi { @GET("/foo") - fun fooGet(): Single + 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 index e547317dec5c..25ab833468e4 100644 --- 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 @@ -15,48 +15,48 @@ import org.openapitools.client.models.User interface FakeApi { @GET("/fake/health") - fun fakeHealthGet(): Single + fun fakeHealthGet(): Observable @POST("/fake/outer/boolean") - fun fakeOuterBooleanSerialize(@Body body: kotlin.Boolean): Single + fun fakeOuterBooleanSerialize(@Body body: kotlin.Boolean): Observable @POST("/fake/outer/composite") - fun fakeOuterCompositeSerialize(@Body outerComposite: OuterComposite): Single + fun fakeOuterCompositeSerialize(@Body outerComposite: OuterComposite): Observable @POST("/fake/outer/number") - fun fakeOuterNumberSerialize(@Body body: java.math.BigDecimal): Single + fun fakeOuterNumberSerialize(@Body body: java.math.BigDecimal): Observable @POST("/fake/outer/string") - fun fakeOuterStringSerialize(@Body body: kotlin.String): Single + fun fakeOuterStringSerialize(@Body body: kotlin.String): Observable @PUT("/fake/body-with-file-schema") - fun testBodyWithFileSchema(@Body fileSchemaTestClass: FileSchemaTestClass): Single + fun testBodyWithFileSchema(@Body fileSchemaTestClass: FileSchemaTestClass): Observable @PUT("/fake/body-with-query-params") - fun testBodyWithQueryParams(@Query("query") query: kotlin.String, @Body user: User): Single + fun testBodyWithQueryParams(@Query("query") query: kotlin.String, @Body user: User): Observable @PATCH("/fake") - fun testClientModel(@Body client: Client): Single + 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): Single + 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): Single + 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): Single + 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): Single + fun testInlineAdditionalProperties(@Body requestBody: kotlin.collections.Map): Observable @FormUrlEncoded @GET("/fake/jsonFormData") - fun testJsonFormData(@Field("param") param: kotlin.String, @Field("param2") param2: kotlin.String): Single + 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): Single + 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 index 848082fca24e..a186587a372c 100644 --- 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 @@ -11,6 +11,6 @@ import org.openapitools.client.models.Client interface FakeClassnameTags123Api { @PATCH("/fake_classname_test") - fun testClassname(@Body client: Client): Single + 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 index 8cafc145ecf3..3c778776b585 100644 --- 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 @@ -12,34 +12,34 @@ import org.openapitools.client.models.Pet interface PetApi { @POST("/pet") - fun addPet(@Body pet: Pet): Single + fun addPet(@Body pet: Pet): Observable @DELETE("/pet/{petId}") - fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String): Single + fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String): Observable @GET("/pet/findByStatus") - fun findPetsByStatus(@Query("status") status: CSVParams): Single> + fun findPetsByStatus(@Query("status") status: CSVParams): Observable> @Deprecated("This api was deprecated") @GET("/pet/findByTags") - fun findPetsByTags(@Query("tags") tags: CSVParams): Single> + fun findPetsByTags(@Query("tags") tags: CSVParams): Observable> @GET("/pet/{petId}") - fun getPetById(@Path("petId") petId: kotlin.Long): Single + fun getPetById(@Path("petId") petId: kotlin.Long): Observable @PUT("/pet") - fun updatePet(@Body pet: Pet): Single + 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): Single + 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): Single + 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): Single + 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 index 281d2fd5f94a..1bd8adb28d00 100644 --- 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 @@ -11,15 +11,15 @@ import org.openapitools.client.models.Order interface StoreApi { @DELETE("/store/order/{order_id}") - fun deleteOrder(@Path("order_id") orderId: kotlin.String): Single + fun deleteOrder(@Path("order_id") orderId: kotlin.String): Observable @GET("/store/inventory") - fun getInventory(): Single> + fun getInventory(): Observable> @GET("/store/order/{order_id}") - fun getOrderById(@Path("order_id") orderId: kotlin.Long): Single + fun getOrderById(@Path("order_id") orderId: kotlin.Long): Observable @POST("/store/order") - fun placeOrder(@Body order: Order): Single + 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 index 73c0386ddbad..aca47deab128 100644 --- 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 @@ -11,27 +11,27 @@ import org.openapitools.client.models.User interface UserApi { @POST("/user") - fun createUser(@Body user: User): Single + fun createUser(@Body user: User): Observable @POST("/user/createWithArray") - fun createUsersWithArrayInput(@Body user: kotlin.Array): Single + fun createUsersWithArrayInput(@Body user: kotlin.Array): Observable @POST("/user/createWithList") - fun createUsersWithListInput(@Body user: kotlin.Array): Single + fun createUsersWithListInput(@Body user: kotlin.Array): Observable @DELETE("/user/{username}") - fun deleteUser(@Path("username") username: kotlin.String): Single + fun deleteUser(@Path("username") username: kotlin.String): Observable @GET("/user/{username}") - fun getUserByName(@Path("username") username: kotlin.String): Single + fun getUserByName(@Path("username") username: kotlin.String): Observable @GET("/user/login") - fun loginUser(@Query("username") username: kotlin.String, @Query("password") password: kotlin.String): Single + fun loginUser(@Query("username") username: kotlin.String, @Query("password") password: kotlin.String): Observable @GET("/user/logout") - fun logoutUser(): Single + fun logoutUser(): Observable @PUT("/user/{username}") - fun updateUser(@Path("username") username: kotlin.String, @Body user: User): Single + 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 index 085d78c72a53..5af331818cb6 100644 --- 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 @@ -3,6 +3,7 @@ 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( @@ -26,6 +27,7 @@ class ApiClient( .baseUrl(baseUrl) .addConverterFactory(ScalarsConverterFactory.create()) .addConverterFactory(GsonConverterFactory.create(Serializer.gson)) + .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) } fun createService(serviceClass: Class): S { 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 index 085d78c72a53..0050437d80a0 100644 --- 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 @@ -3,6 +3,7 @@ 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( @@ -26,6 +27,7 @@ class ApiClient( .baseUrl(baseUrl) .addConverterFactory(ScalarsConverterFactory.create()) .addConverterFactory(GsonConverterFactory.create(Serializer.gson)) + .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) } fun createService(serviceClass: Class): S { From 83a5e3cf1c382f12265c7c9518434e4fcab8e93e Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Fri, 3 Apr 2020 00:49:14 +0300 Subject: [PATCH 18/32] Fix kotlin.md documentation by script export_docs_generators.sh --- docs/generators/kotlin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index f9903f9c7d7a..aaaad4bbe807 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -22,9 +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| -|useCoroutines|Whether to use the Coroutines adapter with the retrofit2 library.| |false| ## IMPORT MAPPING From 9de4d0bacae8cfb462937147f8e5d63575f802c8 Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Wed, 8 Apr 2020 09:31:32 +0300 Subject: [PATCH 19/32] Update Kotlin samples project in pom.xml --- pom.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pom.xml b/pom.xml index b88e81362edc..18fd262d87e9 100644 --- a/pom.xml +++ b/pom.xml @@ -1250,6 +1250,11 @@ samples/client/petstore/javascript-promise samples/client/petstore/javascript-promise-es6 samples/client/petstore/javascript-flowtyped + samples/client/petstore/kotlin + samples/client/petstore/kotlin-jvm-retrofit2-coroutines + samples/client/petstore/kotlin-jvm-retrofit2-rx + samples/client/petstore/kotlin-jvm-retrofit2-rx2 + samples/client/petstore/kotlin-multiplatform samples/client/petstore/python samples/client/petstore/python-experimental samples/client/petstore/python-asyncio @@ -1460,6 +1465,7 @@ samples/client/petstore/kotlin-nonpublic/ samples/client/petstore/kotlin-nullable/ samples/client/petstore/kotlin-okhttp3/ + samples/client/petstore/kotlin-retrofit2/ samples/client/petstore/kotlin-threetenbp/ samples/client/petstore/kotlin-string/ samples/client/petstore/kotlin-moshi-codegen/ From d1321820108f13f0affebc3721bad2798c7825a3 Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Wed, 8 Apr 2020 12:10:27 +0300 Subject: [PATCH 20/32] Revert "Update Kotlin samples project in pom.xml" This reverts commit 9de4d0ba --- pom.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pom.xml b/pom.xml index 18fd262d87e9..b88e81362edc 100644 --- a/pom.xml +++ b/pom.xml @@ -1250,11 +1250,6 @@ samples/client/petstore/javascript-promise samples/client/petstore/javascript-promise-es6 samples/client/petstore/javascript-flowtyped - samples/client/petstore/kotlin - samples/client/petstore/kotlin-jvm-retrofit2-coroutines - samples/client/petstore/kotlin-jvm-retrofit2-rx - samples/client/petstore/kotlin-jvm-retrofit2-rx2 - samples/client/petstore/kotlin-multiplatform samples/client/petstore/python samples/client/petstore/python-experimental samples/client/petstore/python-asyncio @@ -1465,7 +1460,6 @@ samples/client/petstore/kotlin-nonpublic/ samples/client/petstore/kotlin-nullable/ samples/client/petstore/kotlin-okhttp3/ - samples/client/petstore/kotlin-retrofit2/ samples/client/petstore/kotlin-threetenbp/ samples/client/petstore/kotlin-string/ samples/client/petstore/kotlin-moshi-codegen/ From a4fde70702caaac9ab4cba9a3726b64af6809e36 Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Mon, 11 May 2020 15:16:04 +0300 Subject: [PATCH 21/32] 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 --- .../codegen/languages/AbstractKotlinCodegen.java | 6 +++--- .../src/main/resources/kotlin-client/data_class.mustache | 4 ++-- .../main/resources/kotlin-client/interface_opt_var.mustache | 3 --- .../main/resources/kotlin-client/interface_req_var.mustache | 3 --- 4 files changed, 5 insertions(+), 11 deletions(-) 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 aa4015303392..a9d68f32dcf7 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 AbstractKotlinCodegen() { 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/resources/kotlin-client/data_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache index 9cdb761fad80..2ad6d4964d12 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 @@ -68,10 +68,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 e87ea0029748..b171ce5dbbb5 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 @@ -5,9 +5,6 @@ {{#moshi}} @Json(name = "{{{vendorExtensions.x-base-name-literal}}}") {{/moshi}} - {{#gson}} - @SerializedName("{{{vendorExtensions.x-base-name-literal}}}") - {{/gson}} {{#jackson}} @get:JsonProperty("{{{vendorExtensions.x-base-name-literal}}}") {{/jackson}} 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 49bbc4ee5c7e..e15a7f5515e1 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 @@ -5,9 +5,6 @@ {{#moshi}} @Json(name = "{{{vendorExtensions.x-base-name-literal}}}") {{/moshi}} - {{#gson}} - @SerializedName("{{{vendorExtensions.x-base-name-literal}}}") - {{/gson}} {{#jackson}} @get:JsonProperty("{{{vendorExtensions.x-base-name-literal}}}") {{/jackson}} From 4efa4acf3abf198730661d7f62ecde077d69ed2f Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Mon, 11 May 2020 15:28:00 +0300 Subject: [PATCH 22/32] Update Kotlin samples project after last fixes --- .../org/openapitools/client/models/Animal.kt | 2 -- .../openapitools/client/models/EnumArrays.kt | 8 ++++---- .../openapitools/client/models/EnumTest.kt | 20 +++++++++---------- .../client/models/InlineObject2.kt | 10 +++++----- .../org/openapitools/client/models/MapTest.kt | 4 ++-- .../client/models/NullableClass.kt | 2 +- .../org/openapitools/client/models/Order.kt | 6 +++--- .../org/openapitools/client/models/Pet.kt | 6 +++--- .../client/models/NullableClass.kt | 2 +- .../client/models/NullableClass.kt | 2 +- 10 files changed, 30 insertions(+), 32 deletions(-) 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 index 3dc523271960..b0c8aa380ec8 100644 --- 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 @@ -25,9 +25,7 @@ interface Animal : Serializable { private const val serialVersionUID: Long = 123 } - @SerializedName("className") val className: kotlin.String - @SerializedName("color") val color: kotlin.String? } 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 index 6e5bcb295e11..8ffe63f244b1 100644 --- 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 @@ -36,8 +36,8 @@ data class EnumArrays ( */ enum class JustSymbol(val value: kotlin.String){ - @SerializedName(value=">=") greaterThanEqual(">="), - @SerializedName(value="$") dollar("$"); + @SerializedName(value = ">=") greaterThanEqual(">="), + @SerializedName(value = "$") dollar("$"); } /** * @@ -45,8 +45,8 @@ data class EnumArrays ( */ enum class ArrayEnum(val value: kotlin.String){ - @SerializedName(value="fish") fish("fish"), - @SerializedName(value="crab") crab("crab"); + @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/EnumTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/EnumTest.kt index 6651549b729e..a939ed3f41ac 100644 --- 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 @@ -58,9 +58,9 @@ data class EnumTest ( */ enum class EnumStringRequired(val value: kotlin.String){ - @SerializedName(value="UPPER") uPPER("UPPER"), - @SerializedName(value="lower") lower("lower"), - @SerializedName(value="") eMPTY(""); + @SerializedName(value = "UPPER") uPPER("UPPER"), + @SerializedName(value = "lower") lower("lower"), + @SerializedName(value = "") eMPTY(""); } /** * @@ -68,9 +68,9 @@ data class EnumTest ( */ enum class EnumString(val value: kotlin.String){ - @SerializedName(value="UPPER") uPPER("UPPER"), - @SerializedName(value="lower") lower("lower"), - @SerializedName(value="") eMPTY(""); + @SerializedName(value = "UPPER") uPPER("UPPER"), + @SerializedName(value = "lower") lower("lower"), + @SerializedName(value = "") eMPTY(""); } /** * @@ -78,8 +78,8 @@ data class EnumTest ( */ enum class EnumInteger(val value: kotlin.Int){ - @SerializedName(value=1) _1(1), - @SerializedName(value=-1) minus1(-1); + @SerializedName(value = "1") _1(1), + @SerializedName(value = "-1") minus1(-1); } /** * @@ -87,8 +87,8 @@ data class EnumTest ( */ enum class EnumNumber(val value: kotlin.Double){ - @SerializedName(value=1.1) _1period1(1.1), - @SerializedName(value=-1.2) minus1Period2(-1.2); + @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/InlineObject2.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt index b6a6daa80617..29c4d228fd8c 100644 --- 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 @@ -38,8 +38,8 @@ data class InlineObject2 ( */ enum class EnumFormStringArray(val value: kotlin.String){ - @SerializedName(value=">") greaterThan(">"), - @SerializedName(value="$") dollar("$"); + @SerializedName(value = ">") greaterThan(">"), + @SerializedName(value = "$") dollar("$"); } /** * Form parameter enum test (string) @@ -47,9 +47,9 @@ data class InlineObject2 ( */ enum class EnumFormString(val value: kotlin.String){ - @SerializedName(value="_abc") abc("_abc"), - @SerializedName(value="-efg") minusEfg("-efg"), - @SerializedName(value="(xyz)") leftParenthesisXyzRightParenthesis("(xyz)"); + @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/MapTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/MapTest.kt index deb012634aa2..768f0a766039 100644 --- 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 @@ -42,8 +42,8 @@ data class MapTest ( */ enum class MapOfEnumString(val value: kotlin.String){ - @SerializedName(value="UPPER") uPPER("UPPER"), - @SerializedName(value="lower") lower("lower"); + @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/NullableClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/NullableClass.kt index 1229f89385fe..64c690517f95 100644 --- 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 @@ -55,7 +55,7 @@ data class NullableClass ( val objectAndItemsNullableProp: kotlin.collections.Map? = null, @SerializedName("object_items_nullable") val objectItemsNullable: kotlin.collections.Map? = null -) : kotlin.mapOf<String, kotlin.Any>, Serializable { +) : kotlin.collections.HashMap<String, kotlin.Any>, 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 index b46a1fbeded7..e691b5ca8fbd 100644 --- 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 @@ -49,9 +49,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/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 index d36717d56f71..6e0b0b873d16 100644 --- 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 @@ -51,9 +51,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/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 2c86c8921ada..bcfae0ed003a 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,5 +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.mapOf<String, kotlin.String> +) : kotlin.collections.HashMap<String, kotlin.String> 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 41691e8fe8a5..cd2292ff491b 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 @@ -55,7 +55,7 @@ data class NullableClass ( val objectAndItemsNullableProp: kotlin.collections.Map? = null, @Json(name = "object_items_nullable") val objectItemsNullable: kotlin.collections.Map? = null -) : kotlin.mapOf<String, kotlin.Any>, Serializable { +) : kotlin.collections.HashMap<String, kotlin.Any>, Serializable { companion object { private const val serialVersionUID: Long = 123 } From 031dce291714534a600d7734774da7bed1b0bb32 Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Mon, 11 May 2020 15:46:44 +0300 Subject: [PATCH 23/32] Update Kotlin samples project for kotlin-jvm-* --- .../org/openapitools/client/models/Animal.kt | 2 -- .../openapitools/client/models/EnumArrays.kt | 8 ++++---- .../openapitools/client/models/EnumTest.kt | 20 +++++++++---------- .../client/models/InlineObject2.kt | 10 +++++----- .../org/openapitools/client/models/MapTest.kt | 4 ++-- .../client/models/NullableClass.kt | 2 +- .../org/openapitools/client/models/Order.kt | 6 +++--- .../org/openapitools/client/models/Pet.kt | 6 +++--- .../org/openapitools/client/models/Animal.kt | 2 -- .../openapitools/client/models/EnumArrays.kt | 8 ++++---- .../openapitools/client/models/EnumTest.kt | 20 +++++++++---------- .../client/models/InlineObject2.kt | 10 +++++----- .../org/openapitools/client/models/MapTest.kt | 4 ++-- .../client/models/NullableClass.kt | 2 +- .../org/openapitools/client/models/Order.kt | 6 +++--- .../org/openapitools/client/models/Pet.kt | 6 +++--- 16 files changed, 56 insertions(+), 60 deletions(-) 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 index 3dc523271960..b0c8aa380ec8 100644 --- 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 @@ -25,9 +25,7 @@ interface Animal : Serializable { private const val serialVersionUID: Long = 123 } - @SerializedName("className") val className: kotlin.String - @SerializedName("color") val color: kotlin.String? } 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 index 6e5bcb295e11..8ffe63f244b1 100644 --- 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 @@ -36,8 +36,8 @@ data class EnumArrays ( */ enum class JustSymbol(val value: kotlin.String){ - @SerializedName(value=">=") greaterThanEqual(">="), - @SerializedName(value="$") dollar("$"); + @SerializedName(value = ">=") greaterThanEqual(">="), + @SerializedName(value = "$") dollar("$"); } /** * @@ -45,8 +45,8 @@ data class EnumArrays ( */ enum class ArrayEnum(val value: kotlin.String){ - @SerializedName(value="fish") fish("fish"), - @SerializedName(value="crab") crab("crab"); + @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/EnumTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/EnumTest.kt index 6651549b729e..a939ed3f41ac 100644 --- 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 @@ -58,9 +58,9 @@ data class EnumTest ( */ enum class EnumStringRequired(val value: kotlin.String){ - @SerializedName(value="UPPER") uPPER("UPPER"), - @SerializedName(value="lower") lower("lower"), - @SerializedName(value="") eMPTY(""); + @SerializedName(value = "UPPER") uPPER("UPPER"), + @SerializedName(value = "lower") lower("lower"), + @SerializedName(value = "") eMPTY(""); } /** * @@ -68,9 +68,9 @@ data class EnumTest ( */ enum class EnumString(val value: kotlin.String){ - @SerializedName(value="UPPER") uPPER("UPPER"), - @SerializedName(value="lower") lower("lower"), - @SerializedName(value="") eMPTY(""); + @SerializedName(value = "UPPER") uPPER("UPPER"), + @SerializedName(value = "lower") lower("lower"), + @SerializedName(value = "") eMPTY(""); } /** * @@ -78,8 +78,8 @@ data class EnumTest ( */ enum class EnumInteger(val value: kotlin.Int){ - @SerializedName(value=1) _1(1), - @SerializedName(value=-1) minus1(-1); + @SerializedName(value = "1") _1(1), + @SerializedName(value = "-1") minus1(-1); } /** * @@ -87,8 +87,8 @@ data class EnumTest ( */ enum class EnumNumber(val value: kotlin.Double){ - @SerializedName(value=1.1) _1period1(1.1), - @SerializedName(value=-1.2) minus1Period2(-1.2); + @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/InlineObject2.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt index b6a6daa80617..29c4d228fd8c 100644 --- 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 @@ -38,8 +38,8 @@ data class InlineObject2 ( */ enum class EnumFormStringArray(val value: kotlin.String){ - @SerializedName(value=">") greaterThan(">"), - @SerializedName(value="$") dollar("$"); + @SerializedName(value = ">") greaterThan(">"), + @SerializedName(value = "$") dollar("$"); } /** * Form parameter enum test (string) @@ -47,9 +47,9 @@ data class InlineObject2 ( */ enum class EnumFormString(val value: kotlin.String){ - @SerializedName(value="_abc") abc("_abc"), - @SerializedName(value="-efg") minusEfg("-efg"), - @SerializedName(value="(xyz)") leftParenthesisXyzRightParenthesis("(xyz)"); + @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/MapTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/MapTest.kt index deb012634aa2..768f0a766039 100644 --- 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 @@ -42,8 +42,8 @@ data class MapTest ( */ enum class MapOfEnumString(val value: kotlin.String){ - @SerializedName(value="UPPER") uPPER("UPPER"), - @SerializedName(value="lower") lower("lower"); + @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/NullableClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/NullableClass.kt index 1229f89385fe..64c690517f95 100644 --- 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 @@ -55,7 +55,7 @@ data class NullableClass ( val objectAndItemsNullableProp: kotlin.collections.Map? = null, @SerializedName("object_items_nullable") val objectItemsNullable: kotlin.collections.Map? = null -) : kotlin.mapOf<String, kotlin.Any>, Serializable { +) : kotlin.collections.HashMap<String, kotlin.Any>, 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 index b46a1fbeded7..e691b5ca8fbd 100644 --- 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 @@ -49,9 +49,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/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 index d36717d56f71..6e0b0b873d16 100644 --- 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 @@ -51,9 +51,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/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 index 3dc523271960..b0c8aa380ec8 100644 --- 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 @@ -25,9 +25,7 @@ interface Animal : Serializable { private const val serialVersionUID: Long = 123 } - @SerializedName("className") val className: kotlin.String - @SerializedName("color") val color: kotlin.String? } 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 index 6e5bcb295e11..8ffe63f244b1 100644 --- 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 @@ -36,8 +36,8 @@ data class EnumArrays ( */ enum class JustSymbol(val value: kotlin.String){ - @SerializedName(value=">=") greaterThanEqual(">="), - @SerializedName(value="$") dollar("$"); + @SerializedName(value = ">=") greaterThanEqual(">="), + @SerializedName(value = "$") dollar("$"); } /** * @@ -45,8 +45,8 @@ data class EnumArrays ( */ enum class ArrayEnum(val value: kotlin.String){ - @SerializedName(value="fish") fish("fish"), - @SerializedName(value="crab") crab("crab"); + @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/EnumTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/EnumTest.kt index 6651549b729e..a939ed3f41ac 100644 --- 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 @@ -58,9 +58,9 @@ data class EnumTest ( */ enum class EnumStringRequired(val value: kotlin.String){ - @SerializedName(value="UPPER") uPPER("UPPER"), - @SerializedName(value="lower") lower("lower"), - @SerializedName(value="") eMPTY(""); + @SerializedName(value = "UPPER") uPPER("UPPER"), + @SerializedName(value = "lower") lower("lower"), + @SerializedName(value = "") eMPTY(""); } /** * @@ -68,9 +68,9 @@ data class EnumTest ( */ enum class EnumString(val value: kotlin.String){ - @SerializedName(value="UPPER") uPPER("UPPER"), - @SerializedName(value="lower") lower("lower"), - @SerializedName(value="") eMPTY(""); + @SerializedName(value = "UPPER") uPPER("UPPER"), + @SerializedName(value = "lower") lower("lower"), + @SerializedName(value = "") eMPTY(""); } /** * @@ -78,8 +78,8 @@ data class EnumTest ( */ enum class EnumInteger(val value: kotlin.Int){ - @SerializedName(value=1) _1(1), - @SerializedName(value=-1) minus1(-1); + @SerializedName(value = "1") _1(1), + @SerializedName(value = "-1") minus1(-1); } /** * @@ -87,8 +87,8 @@ data class EnumTest ( */ enum class EnumNumber(val value: kotlin.Double){ - @SerializedName(value=1.1) _1period1(1.1), - @SerializedName(value=-1.2) minus1Period2(-1.2); + @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/InlineObject2.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt index b6a6daa80617..29c4d228fd8c 100644 --- 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 @@ -38,8 +38,8 @@ data class InlineObject2 ( */ enum class EnumFormStringArray(val value: kotlin.String){ - @SerializedName(value=">") greaterThan(">"), - @SerializedName(value="$") dollar("$"); + @SerializedName(value = ">") greaterThan(">"), + @SerializedName(value = "$") dollar("$"); } /** * Form parameter enum test (string) @@ -47,9 +47,9 @@ data class InlineObject2 ( */ enum class EnumFormString(val value: kotlin.String){ - @SerializedName(value="_abc") abc("_abc"), - @SerializedName(value="-efg") minusEfg("-efg"), - @SerializedName(value="(xyz)") leftParenthesisXyzRightParenthesis("(xyz)"); + @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/MapTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/MapTest.kt index deb012634aa2..768f0a766039 100644 --- 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 @@ -42,8 +42,8 @@ data class MapTest ( */ enum class MapOfEnumString(val value: kotlin.String){ - @SerializedName(value="UPPER") uPPER("UPPER"), - @SerializedName(value="lower") lower("lower"); + @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/NullableClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/NullableClass.kt index 1229f89385fe..64c690517f95 100644 --- 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 @@ -55,7 +55,7 @@ data class NullableClass ( val objectAndItemsNullableProp: kotlin.collections.Map? = null, @SerializedName("object_items_nullable") val objectItemsNullable: kotlin.collections.Map? = null -) : kotlin.mapOf<String, kotlin.Any>, Serializable { +) : kotlin.collections.HashMap<String, kotlin.Any>, 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 index b46a1fbeded7..e691b5ca8fbd 100644 --- 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 @@ -49,9 +49,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/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 index d36717d56f71..6e0b0b873d16 100644 --- 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 @@ -51,9 +51,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"); } } From c26da0f49b2722e56170a960fee4b0be0ec2e314 Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Mon, 11 May 2020 20:50:33 +0300 Subject: [PATCH 24/32] Update Kotlin readme.md documentations --- docs/generators/kotlin-server.md | 6 +++--- docs/generators/kotlin-spring.md | 6 +++--- docs/generators/kotlin-vertx.md | 6 +++--- docs/generators/kotlin.md | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/generators/kotlin-server.md b/docs/generators/kotlin-server.md index 239ac58e19f1..828b0c99cbee 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 53b8864cd86a..b088f30ba114 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 f7aa85af6211..5f0136bf5e6a 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 aaaad4bbe807..af5c9a3f8743 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -46,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 From 4ece587ccca4cdce339b032b406af120a097faa8 Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Mon, 11 May 2020 20:54:11 +0300 Subject: [PATCH 25/32] Update Kotlin client sample changes --- .../src/main/kotlin/org/openapitools/client/models/Order.kt | 6 +++--- .../src/main/kotlin/org/openapitools/client/models/Pet.kt | 6 +++--- .../src/main/kotlin/org/openapitools/client/models/Order.kt | 6 +++--- .../src/main/kotlin/org/openapitools/client/models/Pet.kt | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) 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 ae3a28a775e2..4f9f9fde4537 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 4a5187302bdb..54d9edce52d7 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 b4963540cad2..396961979b06 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 2978f66f1768..26e9a9dce2ed 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"); } } From 9b42770a2673ee34980e955cc007ec671574a416 Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Tue, 12 May 2020 08:57:03 +0300 Subject: [PATCH 26/32] Fixed encoding braces for generics model --- .../src/main/resources/kotlin-client/data_class.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 2ad6d4964d12..d037a2d8b109 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 @@ -42,7 +42,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}}}{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{#serializableModel}}{{^parcelizeModels}} : {{{parent}}}, Serializable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{^serializableModel}}{{#parcelizeModels}} : {{{parent}}}, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{#serializableModel}}{{#parcelizeModels}} : {{{parent}}}, Serializable, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{#serializableModel}}{{^parcelizeModels}} : Serializable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{^serializableModel}}{{#parcelizeModels}} : Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{#serializableModel}}{{#parcelizeModels}} : Serializable, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#vendorExtensions.x-has-data-class-body}} { {{/vendorExtensions.x-has-data-class-body}} {{#serializableModel}} {{#nonPublicApi}}internal {{/nonPublicApi}}companion object { From 348edf62150b53a298a652956a249d45baa7c6c4 Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Tue, 12 May 2020 08:57:11 +0300 Subject: [PATCH 27/32] Update Kotlin client sample changes --- .../main/kotlin/org/openapitools/client/models/NullableClass.kt | 2 +- .../main/kotlin/org/openapitools/client/models/NullableClass.kt | 2 +- .../main/kotlin/org/openapitools/client/models/NullableClass.kt | 2 +- .../kotlin/org/openapitools/client/models/NullableClass.kt | 2 +- .../main/kotlin/org/openapitools/client/models/NullableClass.kt | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) 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 index 64c690517f95..8da95302c890 100644 --- 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 @@ -55,7 +55,7 @@ data class NullableClass ( val objectAndItemsNullableProp: kotlin.collections.Map? = null, @SerializedName("object_items_nullable") val objectItemsNullable: kotlin.collections.Map? = null -) : kotlin.collections.HashMap<String, kotlin.Any>, Serializable { +) : 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/NullableClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/NullableClass.kt index 64c690517f95..8da95302c890 100644 --- 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 @@ -55,7 +55,7 @@ data class NullableClass ( val objectAndItemsNullableProp: kotlin.collections.Map? = null, @SerializedName("object_items_nullable") val objectItemsNullable: kotlin.collections.Map? = null -) : kotlin.collections.HashMap<String, kotlin.Any>, Serializable { +) : 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/NullableClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/NullableClass.kt index 64c690517f95..8da95302c890 100644 --- 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 @@ -55,7 +55,7 @@ data class NullableClass ( val objectAndItemsNullableProp: kotlin.collections.Map? = null, @SerializedName("object_items_nullable") val objectItemsNullable: kotlin.collections.Map? = null -) : kotlin.collections.HashMap<String, kotlin.Any>, Serializable { +) : kotlin.collections.HashMap, Serializable { companion object { private const val serialVersionUID: Long = 123 } 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 bcfae0ed003a..714adafcd254 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,5 +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<String, kotlin.String> +) : kotlin.collections.HashMap 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 cd2292ff491b..795cb1ad72e5 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 @@ -55,7 +55,7 @@ data class NullableClass ( val objectAndItemsNullableProp: kotlin.collections.Map? = null, @Json(name = "object_items_nullable") val objectItemsNullable: kotlin.collections.Map? = null -) : kotlin.collections.HashMap<String, kotlin.Any>, Serializable { +) : kotlin.collections.HashMap, Serializable { companion object { private const val serialVersionUID: Long = 123 } From 19ebd7c866f7e2ce125b229e0caf2e7bac67780f Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Tue, 12 May 2020 09:28:30 +0300 Subject: [PATCH 28/32] Update Kotlin client sample after merge with master --- .../kotlin-jvm-retrofit2-coroutines/README.md | 6 +++ .../docs/FakeApi.md | 49 +++++++++++++++++++ .../org/openapitools/client/apis/FakeApi.kt | 4 ++ .../kotlin-jvm-retrofit2-rx/README.md | 6 +++ .../kotlin-jvm-retrofit2-rx/docs/FakeApi.md | 49 +++++++++++++++++++ .../org/openapitools/client/apis/FakeApi.kt | 4 ++ .../kotlin-jvm-retrofit2-rx2/README.md | 6 +++ .../kotlin-jvm-retrofit2-rx2/docs/FakeApi.md | 49 +++++++++++++++++++ .../org/openapitools/client/apis/FakeApi.kt | 4 ++ .../petstore/kotlin-multiplatform/README.md | 6 +++ .../kotlin-multiplatform/docs/FakeApi.md | 49 +++++++++++++++++++ .../org/openapitools/client/apis/FakeApi.kt | 38 ++++++++++++++ .../client/infrastructure/ApiClient.kt | 1 + .../openapi3/client/petstore/kotlin/README.md | 6 +++ .../client/petstore/kotlin/docs/FakeApi.md | 49 +++++++++++++++++++ .../org/openapitools/client/apis/FakeApi.kt | 48 ++++++++++++++++++ 16 files changed, 374 insertions(+) diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/README.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/README.md index 3738c4b9c91f..b7028d917a24 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/README.md +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/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-jvm-retrofit2-coroutines/docs/FakeApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FakeApi.md index 6736a3e94e17..fb663183f929 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/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-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 index 25a44f768b29..e32a633abb65 100644 --- 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 @@ -10,12 +10,16 @@ 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 diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/README.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/README.md index 3738c4b9c91f..b7028d917a24 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/README.md +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/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-jvm-retrofit2-rx/docs/FakeApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FakeApi.md index 6736a3e94e17..fb663183f929 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/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-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 index 25ab833468e4..d9ba172b3275 100644 --- 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 @@ -11,12 +11,16 @@ 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 diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/README.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/README.md index 3738c4b9c91f..b7028d917a24 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/README.md +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/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-jvm-retrofit2-rx2/docs/FakeApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FakeApi.md index 6736a3e94e17..fb663183f929 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/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-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 index 1de244afb0fd..2bf08fc5918e 100644 --- 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 @@ -12,12 +12,16 @@ 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 diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/README.md b/samples/openapi3/client/petstore/kotlin-multiplatform/README.md index 36d277710128..aeb7c3ce7984 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/FakeApi.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FakeApi.md index 02154eac1127..dcb60194b742 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/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 4675fdc4b840..06e0a8ba2d86 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 +### http_signature_test + +- **Type**: HTTP basic authentication + ### petstore_auth diff --git a/samples/openapi3/client/petstore/kotlin/docs/FakeApi.md b/samples/openapi3/client/petstore/kotlin/docs/FakeApi.md index 6736a3e94e17..fb663183f929 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) 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 9586f53f8d68..740608cb024d 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 @@ -77,6 +78,53 @@ class FakeApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } + /** + * 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) + } + } + } + /** * * Test serialization of outer boolean types From 4f73f0a16b01295ec42ef9dd9085064645ca000b Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Tue, 12 May 2020 11:36:49 +0300 Subject: [PATCH 29/32] Fixed adding empty braces for inherit from Map/Array --- .../src/main/resources/kotlin-client/data_class.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 d037a2d8b109..8ae6e36879e0 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 @@ -42,7 +42,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 { From a1477f47dd825c3243aa2b73d822694c99f20dac Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Tue, 12 May 2020 11:44:49 +0300 Subject: [PATCH 30/32] Update sample model after last fix with empty braces --- .../main/kotlin/org/openapitools/client/models/NullableClass.kt | 2 +- .../main/kotlin/org/openapitools/client/models/NullableClass.kt | 2 +- .../main/kotlin/org/openapitools/client/models/NullableClass.kt | 2 +- .../kotlin/org/openapitools/client/models/NullableClass.kt | 2 +- .../main/kotlin/org/openapitools/client/models/NullableClass.kt | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) 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 index 8da95302c890..44ef32f26378 100644 --- 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 @@ -55,7 +55,7 @@ data class NullableClass ( val objectAndItemsNullableProp: kotlin.collections.Map? = null, @SerializedName("object_items_nullable") val objectItemsNullable: kotlin.collections.Map? = null -) : kotlin.collections.HashMap, Serializable { +) : 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/NullableClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/NullableClass.kt index 8da95302c890..44ef32f26378 100644 --- 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 @@ -55,7 +55,7 @@ data class NullableClass ( val objectAndItemsNullableProp: kotlin.collections.Map? = null, @SerializedName("object_items_nullable") val objectItemsNullable: kotlin.collections.Map? = null -) : kotlin.collections.HashMap, Serializable { +) : 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/NullableClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/NullableClass.kt index 8da95302c890..44ef32f26378 100644 --- 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 @@ -55,7 +55,7 @@ data class NullableClass ( val objectAndItemsNullableProp: kotlin.collections.Map? = null, @SerializedName("object_items_nullable") val objectItemsNullable: kotlin.collections.Map? = null -) : kotlin.collections.HashMap, Serializable { +) : kotlin.collections.HashMap(), Serializable { companion object { private const val serialVersionUID: Long = 123 } 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 714adafcd254..e535a63ead03 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,5 +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 +) : kotlin.collections.HashMap() 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 795cb1ad72e5..e5d9c43d2a59 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 @@ -55,7 +55,7 @@ data class NullableClass ( val objectAndItemsNullableProp: kotlin.collections.Map? = null, @Json(name = "object_items_nullable") val objectItemsNullable: kotlin.collections.Map? = null -) : kotlin.collections.HashMap, Serializable { +) : kotlin.collections.HashMap(), Serializable { companion object { private const val serialVersionUID: Long = 123 } From 313c1ce1e13bcbd0beb57ffa7110b37e41e0f048 Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Tue, 12 May 2020 13:14:00 +0300 Subject: [PATCH 31/32] Revert adding @SerializedName to Kotlin interface fields through @get:SerializedName as for Jackson --- .../main/resources/kotlin-client/interface_opt_var.mustache | 3 +++ .../main/resources/kotlin-client/interface_req_var.mustache | 3 +++ 2 files changed, 6 insertions(+) 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 b171ce5dbbb5..3284d7b1db41 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 @@ -5,6 +5,9 @@ {{#moshi}} @Json(name = "{{{vendorExtensions.x-base-name-literal}}}") {{/moshi}} + {{#gson}} + @get:SerializedName("{{{vendorExtensions.x-base-name-literal}}}") + {{/gson}} {{#jackson}} @get:JsonProperty("{{{vendorExtensions.x-base-name-literal}}}") {{/jackson}} 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 e15a7f5515e1..ee62fbb2d126 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 @@ -5,6 +5,9 @@ {{#moshi}} @Json(name = "{{{vendorExtensions.x-base-name-literal}}}") {{/moshi}} + {{#gson}} + @get:SerializedName("{{{vendorExtensions.x-base-name-literal}}}") + {{/gson}} {{#jackson}} @get:JsonProperty("{{{vendorExtensions.x-base-name-literal}}}") {{/jackson}} From 6b3cc8f92661a7ab41820a65f272a575733df989 Mon Sep 17 00:00:00 2001 From: Nikita Karnaukh Date: Tue, 12 May 2020 13:18:04 +0300 Subject: [PATCH 32/32] Update Kotlin client samples with adding @get:SerializedName --- .../src/main/kotlin/org/openapitools/client/models/Animal.kt | 2 ++ .../src/main/kotlin/org/openapitools/client/models/Animal.kt | 2 ++ .../src/main/kotlin/org/openapitools/client/models/Animal.kt | 2 ++ 3 files changed, 6 insertions(+) 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 index b0c8aa380ec8..86992f00d6a6 100644 --- 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 @@ -25,7 +25,9 @@ interface Animal : Serializable { 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/Animal.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Animal.kt index b0c8aa380ec8..86992f00d6a6 100644 --- 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 @@ -25,7 +25,9 @@ interface Animal : Serializable { 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/Animal.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Animal.kt index b0c8aa380ec8..86992f00d6a6 100644 --- 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 @@ -25,7 +25,9 @@ interface Animal : Serializable { private const val serialVersionUID: Long = 123 } + @get:SerializedName("className") val className: kotlin.String + @get:SerializedName("color") val color: kotlin.String? }