diff --git a/bin/kotlin-client-all.sh b/bin/kotlin-client-all.sh index 8663752ab52..137c6eb5e89 100755 --- a/bin/kotlin-client-all.sh +++ b/bin/kotlin-client-all.sh @@ -1,6 +1,7 @@ #!/bin/sh ./bin/kotlin-client-gson.sh +./bin/kotlin-client-jackson.sh ./bin/kotlin-client-moshi-codegen.sh ./bin/kotlin-client-nonpublic.sh ./bin/kotlin-client-okhttp3.sh diff --git a/bin/kotlin-client-jackson.sh b/bin/kotlin-client-jackson.sh new file mode 100755 index 00000000000..516ffc69314 --- /dev/null +++ b/bin/kotlin-client-jackson.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +while [ -h "$SCRIPT" ] ; do + ls=$(ls -ld "$SCRIPT") + link=$(expr "$ls" : '.*-> \(.*\)$') + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=$(dirname "$SCRIPT")/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=$(dirname "$SCRIPT")/.. + APP_DIR=$(cd "${APP_DIR}"; pwd) +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn -B clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-jackson --additional-properties serializationLibrary=jackson --additional-properties enumPropertyNaming=UPPERCASE -o samples/client/petstore/kotlin-jackson $@" + +java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/docs/generators/kotlin-server.md b/docs/generators/kotlin-server.md index 2089f70a192..239ac58e19f 100644 --- a/docs/generators/kotlin-server.md +++ b/docs/generators/kotlin-server.md @@ -20,7 +20,7 @@ sidebar_label: kotlin-server |packageName|Generated artifact package name.| |org.openapitools.server| |parcelizeModels|toggle "@Parcelize" for generated models| |null| |serializableModel|boolean - toggle "implements Serializable" for generated models| |null| -|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi| +|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson' or 'jackson'| |moshi| |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| diff --git a/docs/generators/kotlin-spring.md b/docs/generators/kotlin-spring.md index 2e66c299400..53b8864cd86 100644 --- a/docs/generators/kotlin-spring.md +++ b/docs/generators/kotlin-spring.md @@ -23,7 +23,7 @@ sidebar_label: kotlin-spring |parcelizeModels|toggle "@Parcelize" for generated models| |null| |reactive|use coroutines for reactive behavior| |false| |serializableModel|boolean - toggle "implements Serializable" for generated models| |null| -|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi| +|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson' or 'jackson'| |moshi| |serverPort|configuration the port in which the sever is to run on| |8080| |serviceImplementation|generate stub service implementations that extends service interfaces. If this is set to true service interfaces will also be generated| |false| |serviceInterface|generate service interfaces to go alongside controllers. In most cases this option would be used to update an existing project, so not to override implementations. Useful to help facilitate the generation gap pattern| |false| diff --git a/docs/generators/kotlin-vertx.md b/docs/generators/kotlin-vertx.md index cc09c033b86..f7aa85af621 100644 --- a/docs/generators/kotlin-vertx.md +++ b/docs/generators/kotlin-vertx.md @@ -14,7 +14,7 @@ sidebar_label: kotlin-vertx |packageName|Generated artifact package name.| |org.openapitools| |parcelizeModels|toggle "@Parcelize" for generated models| |null| |serializableModel|boolean - toggle "implements Serializable" for generated models| |null| -|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi| +|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson' or 'jackson'| |moshi| |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| diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index 11c50d5572b..f212508f70b 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -18,7 +18,7 @@ sidebar_label: kotlin |parcelizeModels|toggle "@Parcelize" for generated models| |null| |requestDateConverter|JVM-Option. Defines in how to handle date-time objects that are used for a request (as query or parameter)|
**toJson**
[DEFAULT] Date formater option using a json converter.
**toString**
Use the 'toString'-method of the date-time object to retrieve the related string representation.
|toJson| |serializableModel|boolean - toggle "implements Serializable" for generated models| |null| -|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi| +|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson' or 'jackson'| |moshi| |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| 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 40e9f2e68b5..aa401530339 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 @@ -41,9 +41,9 @@ import static org.openapitools.codegen.utils.StringUtils.*; public abstract class AbstractKotlinCodegen extends DefaultCodegen implements CodegenConfig { - public static final String SERIALIZATION_LIBRARY_DESC = "What serialization library to use: 'moshi' (default), or 'gson'"; + public static final String SERIALIZATION_LIBRARY_DESC = "What serialization library to use: 'moshi' (default), or 'gson' or 'jackson'"; - public enum SERIALIZATION_LIBRARY_TYPE {moshi, gson} + public enum SERIALIZATION_LIBRARY_TYPE {moshi, gson, jackson} public static final String MODEL_MUTABLE = "modelMutable"; public static final String MODEL_MUTABLE_DESC = "Create mutable models"; 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 ae8409c4a2d..15ed281c16d 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 @@ -323,18 +323,26 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { private void addSupportingSerializerAdapters(final String infrastructureFolder) { supportingFiles.add(new SupportingFile("jvm-common/infrastructure/Serializer.kt.mustache", infrastructureFolder, "Serializer.kt")); supportingFiles.add(new SupportingFile("jvm-common/infrastructure/ByteArrayAdapter.kt.mustache", infrastructureFolder, "ByteArrayAdapter.kt")); - supportingFiles.add(new SupportingFile("jvm-common/infrastructure/LocalDateAdapter.kt.mustache", infrastructureFolder, "LocalDateAdapter.kt")); - supportingFiles.add(new SupportingFile("jvm-common/infrastructure/LocalDateTimeAdapter.kt.mustache", infrastructureFolder, "LocalDateTimeAdapter.kt")); - supportingFiles.add(new SupportingFile("jvm-common/infrastructure/OffsetDateTimeAdapter.kt.mustache", infrastructureFolder, "OffsetDateTimeAdapter.kt")); - + switch (getSerializationLibrary()) { case moshi: supportingFiles.add(new SupportingFile("jvm-common/infrastructure/UUIDAdapter.kt.mustache", infrastructureFolder, "UUIDAdapter.kt")); + supportingFiles.add(new SupportingFile("jvm-common/infrastructure/LocalDateAdapter.kt.mustache", infrastructureFolder, "LocalDateAdapter.kt")); + supportingFiles.add(new SupportingFile("jvm-common/infrastructure/LocalDateTimeAdapter.kt.mustache", infrastructureFolder, "LocalDateTimeAdapter.kt")); + supportingFiles.add(new SupportingFile("jvm-common/infrastructure/OffsetDateTimeAdapter.kt.mustache", infrastructureFolder, "OffsetDateTimeAdapter.kt")); break; case gson: supportingFiles.add(new SupportingFile("jvm-common/infrastructure/DateAdapter.kt.mustache", infrastructureFolder, "DateAdapter.kt")); + supportingFiles.add(new SupportingFile("jvm-common/infrastructure/LocalDateAdapter.kt.mustache", infrastructureFolder, "LocalDateAdapter.kt")); + supportingFiles.add(new SupportingFile("jvm-common/infrastructure/LocalDateTimeAdapter.kt.mustache", infrastructureFolder, "LocalDateTimeAdapter.kt")); + supportingFiles.add(new SupportingFile("jvm-common/infrastructure/OffsetDateTimeAdapter.kt.mustache", infrastructureFolder, "OffsetDateTimeAdapter.kt")); break; + + case jackson: + //supportingFiles.add(new SupportingFile("jvm-common/infrastructure/DateAdapter.kt.mustache", infrastructureFolder, "DateAdapter.kt")); + break; + } } 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 765ba75fbe9..31b844fd30c 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 @@ -49,6 +49,11 @@ dependencies { {{#gson}} compile "com.google.code.gson:gson:2.8.6" {{/gson}} + {{#jackson}} + compile "com.fasterxml.jackson.module:jackson-module-kotlin:2.10.2" + compile "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.10.2" + compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.10.2" + {{/jackson}} {{#jvm-okhttp3}} compile "com.squareup.okhttp3:okhttp:3.12.6" {{/jvm-okhttp3}} 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 d4dde194c0d..7ec7de32c8b 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 @@ -8,6 +8,10 @@ import com.squareup.moshi.Json import com.squareup.moshi.JsonClass {{/moshiCodeGen}} {{/moshi}} +{{#jackson}} +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.annotation.JsonFormat +{{/jackson}} {{#parcelizeModels}} import android.os.Parcelable import kotlinx.android.parcel.Parcelize @@ -53,6 +57,7 @@ import java.io.Serializable * Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} */ {{#multiplatform}}@Serializable(with = {{nameInCamelCase}}.Serializer::class){{/multiplatform}} + {{#jackson}}{{#isPrimitiveType}}@JsonFormat(shape = JsonFormat.Shape.NATURAL){{/isPrimitiveType}}{{^isPrimitiveType}}@JsonFormat(shape = JsonFormat.Shape.OBJECT){{/isPrimitiveType}}{{/jackson}} {{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{{nameInCamelCase}}}(val value: {{#isListContainer}}{{{ nestedType }}}{{/isListContainer}}{{^isListContainer}}{{{dataType}}}{{/isListContainer}}){ {{#allowableValues}} {{#enumVars}} @@ -63,6 +68,9 @@ import java.io.Serializable {{#gson}} @SerializedName(value={{{value}}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} {{/gson}} + {{#jackson}} + @JsonProperty(value={{{value}}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} + {{/jackson}} {{/multiplatform}} {{#multiplatform}} {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache index f8c93c5fdd5..5281ec91b63 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache @@ -8,5 +8,12 @@ {{#gson}} @SerializedName("{{{vendorExtensions.x-base-name-literal}}}") {{/gson}} + {{#jackson}} + {{#isDateTime}} + @JsonFormat + (shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy hh:mm:ss") + {{/isDateTime}} + @JsonProperty("{{{vendorExtensions.x-base-name-literal}}}") + {{/jackson}} {{/multiplatform}} - {{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") {{/multiplatform}}{{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isListContainer}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{classname}}.{{{nameInCamelCase}}}>{{/isListContainer}}{{^isListContainer}}{{classname}}.{{{nameInCamelCase}}}{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{#defaultvalue}}{{defaultvalue}}{{/defaultvalue}}{{^defaultvalue}}null{{/defaultvalue}} \ No newline at end of file + {{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") {{/multiplatform}}{{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isListContainer}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{classname}}.{{{nameInCamelCase}}}>{{/isListContainer}}{{^isListContainer}}{{classname}}.{{{nameInCamelCase}}}{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{#defaultvalue}}{{defaultvalue}}{{/defaultvalue}}{{^defaultvalue}}null{{/defaultvalue}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache index 9fdca570a59..4f0aa8007de 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache @@ -8,5 +8,8 @@ {{#gson}} @SerializedName("{{{vendorExtensions.x-base-name-literal}}}") {{/gson}} + {{#jackson}} + @JsonProperty("{{{vendorExtensions.x-base-name-literal}}}") + {{/jackson}} {{/multiplatform}} - {{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") @Required {{/multiplatform}}{{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isListContainer}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{classname}}.{{{nameInCamelCase}}}>{{/isListContainer}}{{^isListContainer}}{{classname}}.{{{nameInCamelCase}}}{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}}?{{/isNullable}} \ No newline at end of file + {{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") @Required {{/multiplatform}}{{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isListContainer}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{classname}}.{{{nameInCamelCase}}}>{{/isListContainer}}{{^isListContainer}}{{classname}}.{{{nameInCamelCase}}}{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}}?{{/isNullable}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/enum_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/enum_class.mustache index 947f34ea901..bee88983024 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/enum_class.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/enum_class.mustache @@ -16,6 +16,7 @@ import kotlinx.serialization.internal.CommonEnumSerializer * Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} */ {{#multiplatform}}@Serializable(with = {{classname}}.Serializer::class){{/multiplatform}} +{{#jackson}}@JsonFormat(shape = JsonFormat.Shape.OBJECT){{/jackson}} {{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{classname}}(val value: {{{dataType}}}){ {{#allowableValues}}{{#enumVars}} @@ -26,6 +27,9 @@ import kotlinx.serialization.internal.CommonEnumSerializer {{#gson}} @SerializedName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{/gson}} + {{#jackson}} + @JsonProperty(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) + {{/jackson}} {{/multiplatform}} {{#isListContainer}} {{#isList}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/LocalDateAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/LocalDateAdapter.kt.mustache index 152266a5964..34de6bc3895 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/LocalDateAdapter.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/LocalDateAdapter.kt.mustache @@ -60,4 +60,4 @@ import org.threeten.bp.format.DateTimeFormatter } } } -{{/gson}} \ No newline at end of file +{{/gson}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache index 3493dee19aa..8092f8eb71d 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache @@ -22,6 +22,13 @@ import org.threeten.bp.OffsetDateTime {{/threetenbp}} import java.util.UUID {{/gson}} +{{#jackson}} +import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.datatype.jdk8.Jdk8Module +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule +import com.fasterxml.jackson.annotation.JsonInclude +import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper +{{/jackson}} import java.util.Date {{#nonPublicApi}}internal {{/nonPublicApi}}object Serializer { @@ -57,4 +64,11 @@ import java.util.Date gsonBuilder.create() } {{/gson}} +{{#jackson}} + @JvmStatic + val jacksonObjectMapper: ObjectMapper = jacksonObjectMapper() + .registerModule(Jdk8Module()) + .registerModule(JavaTimeModule()) + .setSerializationInclusion(JsonInclude.Include.NON_ABSENT) +{{/jackson}} } diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache index 9a15406f1bb..8913d9e5ae3 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache @@ -78,10 +78,13 @@ import java.io.File {{#gson}} MediaType.parse(mediaType), Serializer.gson.toJson(content, T::class.java) {{/gson}} + {{#jackson}} + MediaType.parse(mediaType), Serializer.jackson.toJson(content, T::class.java) + {{/jackson}} ) {{/jvm-okhttp3}} {{#jvm-okhttp4}} - mediaType == JsonMediaType -> {{#moshi}}Serializer.moshi.adapter(T::class.java).toJson(content){{/moshi}}{{#gson}}Serializer.gson.toJson(content, T::class.java){{/gson}}.toRequestBody( + mediaType == JsonMediaType -> {{#moshi}}Serializer.moshi.adapter(T::class.java).toJson(content){{/moshi}}{{#gson}}Serializer.gson.toJson(content, T::class.java){{/gson}}{{#jackson}}Serializer.jacksonObjectMapper.writeValueAsString(content){{/jackson}}.toRequestBody( mediaType.toMediaTypeOrNull() ) {{/jvm-okhttp4}} @@ -99,7 +102,7 @@ import java.io.File return null } return when(mediaType) { - JsonMediaType -> {{#moshi}}Serializer.moshi.adapter(T::class.java).fromJson(bodyContent){{/moshi}}{{#gson}}Serializer.gson.fromJson(bodyContent, T::class.java){{/gson}} + JsonMediaType -> {{#moshi}}Serializer.moshi.adapter(T::class.java).fromJson(bodyContent){{/moshi}}{{#gson}}Serializer.gson.fromJson(bodyContent, T::class.java){{/gson}}{{#jackson}}Serializer.jacksonObjectMapper.readValue(bodyContent, T::class.java){{/jackson}} else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -146,7 +149,7 @@ import java.io.File {{#isBasicBearer}} if (requestConfig.headers[Authorization].isNullOrEmpty()) { accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer " + accessToken + requestConfig.headers[Authorization] = "Bearer $accessToken" } } {{/isBasicBearer}} @@ -154,7 +157,7 @@ import java.io.File {{#isOAuth}} if (requestConfig.headers[Authorization].isNullOrEmpty()) { accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer " + accessToken + requestConfig.headers[Authorization] = "Bearer $accessToken " } } {{/isOAuth}} @@ -251,6 +254,7 @@ import java.io.File } } + {{^jackson}} protected inline fun parseDateToQueryString(value : T): String { {{#toJson}} /* @@ -270,4 +274,5 @@ import java.io.File return value.toString() {{/toJson}} } + {{/jackson}} } diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 0907e471f43..7876fe75504 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -85,7 +85,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 " } } } diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index 51a090c496e..89eb4f6b0ac 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -22,10 +22,13 @@ import com.google.gson.annotations.SerializedName data class ApiResponse ( @SerializedName("code") - val code: kotlin.Int? = null, + val code: kotlin.Int? = null +, @SerializedName("type") - val type: kotlin.String? = null, + val type: kotlin.String? = null +, @SerializedName("message") val message: kotlin.String? = null + ) diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Category.kt index 0e978e11fd6..b43d83321c8 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -21,8 +21,10 @@ import com.google.gson.annotations.SerializedName data class Category ( @SerializedName("id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @SerializedName("name") val name: kotlin.String? = null + ) diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Order.kt index ae3a28a775e..2439ec7763c 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 @@ -25,18 +25,24 @@ import com.google.gson.annotations.SerializedName data class Order ( @SerializedName("id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @SerializedName("petId") - val petId: kotlin.Long? = null, + val petId: kotlin.Long? = null +, @SerializedName("quantity") - val quantity: kotlin.Int? = null, + val quantity: kotlin.Int? = null +, @SerializedName("shipDate") - val shipDate: java.time.OffsetDateTime? = null, + val shipDate: java.time.OffsetDateTime? = null +, /* Order Status */ @SerializedName("status") - val status: Order.Status? = null, + val status: Order.Status? = null +, @SerializedName("complete") val complete: kotlin.Boolean? = null + ) { /** @@ -44,6 +50,7 @@ data class Order ( * Values: placed,approved,delivered */ + enum class Status(val value: kotlin.String){ @SerializedName(value="placed") placed("placed"), @SerializedName(value="approved") approved("approved"), diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt index 4a5187302bd..4ad478c670e 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 @@ -27,18 +27,24 @@ import com.google.gson.annotations.SerializedName data class Pet ( @SerializedName("name") - val name: kotlin.String, + val name: kotlin.String +, @SerializedName("photoUrls") - val photoUrls: kotlin.Array, + val photoUrls: kotlin.Array +, @SerializedName("id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @SerializedName("category") - val category: Category? = null, + val category: Category? = null +, @SerializedName("tags") - val tags: kotlin.Array? = null, + val tags: kotlin.Array? = null +, /* pet status in the store */ @SerializedName("status") val status: Pet.Status? = null + ) { /** @@ -46,6 +52,7 @@ data class Pet ( * Values: available,pending,sold */ + enum class Status(val value: kotlin.String){ @SerializedName(value="available") available("available"), @SerializedName(value="pending") pending("pending"), diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt index 71d9cb767be..22c75475220 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -21,8 +21,10 @@ import com.google.gson.annotations.SerializedName data class Tag ( @SerializedName("id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @SerializedName("name") val name: kotlin.String? = null + ) diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/User.kt index c2158935c59..ea40dbe7d71 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/User.kt @@ -27,21 +27,29 @@ import com.google.gson.annotations.SerializedName data class User ( @SerializedName("id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @SerializedName("username") - val username: kotlin.String? = null, + val username: kotlin.String? = null +, @SerializedName("firstName") - val firstName: kotlin.String? = null, + val firstName: kotlin.String? = null +, @SerializedName("lastName") - val lastName: kotlin.String? = null, + val lastName: kotlin.String? = null +, @SerializedName("email") - val email: kotlin.String? = null, + val email: kotlin.String? = null +, @SerializedName("password") - val password: kotlin.String? = null, + val password: kotlin.String? = null +, @SerializedName("phone") - val phone: kotlin.String? = null, + val phone: kotlin.String? = null +, /* User Status */ @SerializedName("userStatus") val userStatus: kotlin.Int? = null + ) diff --git a/samples/client/petstore/kotlin-jackson/.openapi-generator-ignore b/samples/client/petstore/kotlin-jackson/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/kotlin-jackson/.openapi-generator/VERSION b/samples/client/petstore/kotlin-jackson/.openapi-generator/VERSION new file mode 100644 index 00000000000..bfbf77eb7fa --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/README.md b/samples/client/petstore/kotlin-jackson/README.md new file mode 100644 index 00000000000..aef4ea15bee --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/README.md @@ -0,0 +1,90 @@ +# 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/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + + +## Documentation for Models + + - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) + - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.Order](docs/Order.md) + - [org.openapitools.client.models.Pet](docs/Pet.md) + - [org.openapitools.client.models.Tag](docs/Tag.md) + - [org.openapitools.client.models.User](docs/User.md) + + + +## Documentation for Authorization + + +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + + +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + diff --git a/samples/client/petstore/kotlin-jackson/build.gradle b/samples/client/petstore/kotlin-jackson/build.gradle new file mode 100644 index 00000000000..13a4b140768 --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/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' + + 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 "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" + compile "com.fasterxml.jackson.module:jackson-module-kotlin:2.10.2" + compile "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.10.2" + compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.10.2" + compile "com.squareup.okhttp3:okhttp:4.2.2" + testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0" +} diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/META-INF/kotlin-petstore-jackson.kotlin_module b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/META-INF/kotlin-petstore-jackson.kotlin_module new file mode 100644 index 00000000000..38c4425da8d Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/META-INF/kotlin-petstore-jackson.kotlin_module differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/ApplicationKt.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/ApplicationKt.class new file mode 100644 index 00000000000..d44eb27f99a Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/ApplicationKt.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/PetApi$WhenMappings.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/PetApi$WhenMappings.class new file mode 100644 index 00000000000..9251a566438 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/PetApi$WhenMappings.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/PetApi.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/PetApi.class new file mode 100644 index 00000000000..c6d591f8636 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/PetApi.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/StoreApi$WhenMappings.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/StoreApi$WhenMappings.class new file mode 100644 index 00000000000..586f194f4dc Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/StoreApi$WhenMappings.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/StoreApi.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/StoreApi.class new file mode 100644 index 00000000000..3240ab8d74c Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/StoreApi.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/UserApi$WhenMappings.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/UserApi$WhenMappings.class new file mode 100644 index 00000000000..2a3170461c2 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/UserApi$WhenMappings.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/UserApi.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/UserApi.class new file mode 100644 index 00000000000..a77b699e57b Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/UserApi.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiAbstractionsKt$defaultMultiValueConverter$1.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiAbstractionsKt$defaultMultiValueConverter$1.class new file mode 100644 index 00000000000..3569514091d Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiAbstractionsKt$defaultMultiValueConverter$1.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiAbstractionsKt.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiAbstractionsKt.class new file mode 100644 index 00000000000..157ae0f97df Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiAbstractionsKt.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiClient$Companion$client$2.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiClient$Companion$client$2.class new file mode 100644 index 00000000000..7a133a481ec Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiClient$Companion$client$2.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiClient$Companion.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiClient$Companion.class new file mode 100644 index 00000000000..3cb0f553100 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiClient$Companion.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiClient$WhenMappings.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiClient$WhenMappings.class new file mode 100644 index 00000000000..9f70f904394 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiClient$WhenMappings.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiClient.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiClient.class new file mode 100644 index 00000000000..90ee4132ab9 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiClient.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.class new file mode 100644 index 00000000000..419643d8f06 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApplicationDelegates$SetOnce.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApplicationDelegates$SetOnce.class new file mode 100644 index 00000000000..ab4fcfc583e Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApplicationDelegates$SetOnce.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApplicationDelegates.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApplicationDelegates.class new file mode 100644 index 00000000000..f4efcc20bd3 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApplicationDelegates.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ClientError.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ClientError.class new file mode 100644 index 00000000000..603a689cdca Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ClientError.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ClientException$Companion.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ClientException$Companion.class new file mode 100644 index 00000000000..6409367eb2b Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ClientException$Companion.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ClientException.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ClientException.class new file mode 100644 index 00000000000..f735c489f1b Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ClientException.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Informational.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Informational.class new file mode 100644 index 00000000000..ab8af7092fd Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Informational.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Redirection.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Redirection.class new file mode 100644 index 00000000000..0fa433897df Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Redirection.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/RequestConfig.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/RequestConfig.class new file mode 100644 index 00000000000..1763aca2dbe Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/RequestConfig.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/RequestMethod.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/RequestMethod.class new file mode 100644 index 00000000000..682c76a806c Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/RequestMethod.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ResponseExtensionsKt.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ResponseExtensionsKt.class new file mode 100644 index 00000000000..71652625e7c Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ResponseExtensionsKt.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ResponseType.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ResponseType.class new file mode 100644 index 00000000000..93cb48a774a Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ResponseType.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Serializer.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Serializer.class new file mode 100644 index 00000000000..a43232fb4d3 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Serializer.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ServerError.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ServerError.class new file mode 100644 index 00000000000..ba8714325e5 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ServerError.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ServerException$Companion.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ServerException$Companion.class new file mode 100644 index 00000000000..ae26cf57a4d Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ServerException$Companion.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ServerException.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ServerException.class new file mode 100644 index 00000000000..0d0ab75568b Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ServerException.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Success.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Success.class new file mode 100644 index 00000000000..7cc9b5cc535 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Success.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/ApiResponse.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/ApiResponse.class new file mode 100644 index 00000000000..5a17f40b3b3 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/ApiResponse.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Category.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Category.class new file mode 100644 index 00000000000..630089b53ed Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Category.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Order$Status.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Order$Status.class new file mode 100644 index 00000000000..9e7cf40b027 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Order$Status.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Order.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Order.class new file mode 100644 index 00000000000..4f0ee8cafa6 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Order.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Pet$Status.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Pet$Status.class new file mode 100644 index 00000000000..280b4167bab Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Pet$Status.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Pet.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Pet.class new file mode 100644 index 00000000000..e16b319a5ab Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Pet.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Tag.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Tag.class new file mode 100644 index 00000000000..7b2a6a300d7 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Tag.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/User.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/User.class new file mode 100644 index 00000000000..de1773c74ac Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/User.class differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/build-history.bin b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/build-history.bin new file mode 100644 index 00000000000..2fefee2a909 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/build-history.bin differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab new file mode 100644 index 00000000000..370fbecceee Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.keystream b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.keystream new file mode 100644 index 00000000000..684a2e6b68c Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.keystream differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.keystream.len new file mode 100644 index 00000000000..b92ca80caa0 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.keystream.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.len new file mode 100644 index 00000000000..8fe89d82d54 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.values.at new file mode 100644 index 00000000000..4fa36e1334d Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.values.at differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab_i b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab_i new file mode 100644 index 00000000000..dd1f4b65dd5 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab_i differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab_i.len new file mode 100644 index 00000000000..131e265740f Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab_i.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab new file mode 100644 index 00000000000..9a71d23556c Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream new file mode 100644 index 00000000000..723285bfc41 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len new file mode 100644 index 00000000000..55d7e48d140 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len new file mode 100644 index 00000000000..fa432244558 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at new file mode 100644 index 00000000000..173b53e8670 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i new file mode 100644 index 00000000000..a17670a8ff1 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len new file mode 100644 index 00000000000..131e265740f Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab new file mode 100644 index 00000000000..95891633202 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab.keystream b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab.keystream new file mode 100644 index 00000000000..c0e36ab9e46 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab.keystream differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab.keystream.len new file mode 100644 index 00000000000..1c209ae2a7d Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab.keystream.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab.len new file mode 100644 index 00000000000..2a17e6e5bd9 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab.values.at new file mode 100644 index 00000000000..6d1a52af89c Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab.values.at differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab_i b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab_i new file mode 100644 index 00000000000..28d0f1a654d Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab_i differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab_i.len new file mode 100644 index 00000000000..131e265740f Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab_i.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab new file mode 100644 index 00000000000..95891633202 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab.keystream b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab.keystream new file mode 100644 index 00000000000..c0e36ab9e46 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab.keystream differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab.keystream.len new file mode 100644 index 00000000000..1c209ae2a7d Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab.keystream.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab.len new file mode 100644 index 00000000000..2a17e6e5bd9 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab.values.at new file mode 100644 index 00000000000..74a070ef89a Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab.values.at differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab_i b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab_i new file mode 100644 index 00000000000..28d0f1a654d Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab_i differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab_i.len new file mode 100644 index 00000000000..131e265740f Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab_i.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab new file mode 100644 index 00000000000..3927e9fc2c2 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream new file mode 100644 index 00000000000..3e846733e62 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len new file mode 100644 index 00000000000..167eee53012 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len new file mode 100644 index 00000000000..b67c22714fc Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at new file mode 100644 index 00000000000..7af9d581310 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i new file mode 100644 index 00000000000..73211a26fa6 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len new file mode 100644 index 00000000000..131e265740f Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab new file mode 100644 index 00000000000..9d08a3624d7 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.keystream b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.keystream new file mode 100644 index 00000000000..79ca656ddad Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.keystream differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len new file mode 100644 index 00000000000..9a568e9309b Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.len new file mode 100644 index 00000000000..a9f80ae0249 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.values.at new file mode 100644 index 00000000000..33c7d6ca799 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.values.at differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab_i b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab_i new file mode 100644 index 00000000000..94e43615882 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab_i differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab_i.len new file mode 100644 index 00000000000..131e265740f Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab_i.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab new file mode 100644 index 00000000000..25bef240969 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream new file mode 100644 index 00000000000..0e8863faf00 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream.len new file mode 100644 index 00000000000..b1c61efb430 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.len new file mode 100644 index 00000000000..b797c4d2ee8 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.values.at new file mode 100644 index 00000000000..5ac90143bf1 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.values.at differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab_i b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab_i new file mode 100644 index 00000000000..e719f2bcbde Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab_i differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab_i.len new file mode 100644 index 00000000000..131e265740f Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab_i.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab new file mode 100644 index 00000000000..539c1455905 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream new file mode 100644 index 00000000000..1c3de6c8041 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len new file mode 100644 index 00000000000..b92ca80caa0 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.len new file mode 100644 index 00000000000..8fe89d82d54 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at new file mode 100644 index 00000000000..4611327238b Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i new file mode 100644 index 00000000000..7b5d90e2b3b Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len new file mode 100644 index 00000000000..131e265740f Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab new file mode 100644 index 00000000000..b9ad114a5e9 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream new file mode 100644 index 00000000000..718f8d66e46 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len new file mode 100644 index 00000000000..47c11026976 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.len new file mode 100644 index 00000000000..ec8f944c8ac Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.values.at new file mode 100644 index 00000000000..96d372e9e92 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.values.at differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab_i b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab_i new file mode 100644 index 00000000000..dccfd2076eb Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab_i differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab_i.len new file mode 100644 index 00000000000..131e265740f Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab_i.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab new file mode 100644 index 00000000000..826a296d762 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream new file mode 100644 index 00000000000..3aeb44950ad Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len new file mode 100644 index 00000000000..55df098132a Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab.len new file mode 100644 index 00000000000..cf8a30a1c96 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab.values.at new file mode 100644 index 00000000000..ee4d5b4aac3 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab.values.at differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i new file mode 100644 index 00000000000..33f1fc37d80 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i.len new file mode 100644 index 00000000000..131e265740f Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/counters.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/counters.tab new file mode 100644 index 00000000000..8efbaaa2df5 --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/counters.tab @@ -0,0 +1,2 @@ +19 +0 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab new file mode 100644 index 00000000000..1b617c8bee6 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.keystream b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.keystream new file mode 100644 index 00000000000..5a9326fffeb Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.keystream differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.keystream.len new file mode 100644 index 00000000000..bc1721ad72a Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.keystream.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.len new file mode 100644 index 00000000000..14f7c061cc4 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.values.at new file mode 100644 index 00000000000..dbc6bf90fde Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.values.at differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab_i b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab_i new file mode 100644 index 00000000000..3bee32461ba Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab_i differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab_i.len new file mode 100644 index 00000000000..131e265740f Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab_i.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab new file mode 100644 index 00000000000..6843312afb2 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.keystream b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.keystream new file mode 100644 index 00000000000..54555db3903 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.keystream differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.keystream.len new file mode 100644 index 00000000000..2b895e774de Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.keystream.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.len new file mode 100644 index 00000000000..14f7c061cc4 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.values.at new file mode 100644 index 00000000000..9acac0d4af7 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.values.at differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab_i b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab_i new file mode 100644 index 00000000000..41018a93c6b Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab_i differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab_i.len new file mode 100644 index 00000000000..131e265740f Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab_i.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab new file mode 100644 index 00000000000..6a1c931aff7 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.keystream b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.keystream new file mode 100644 index 00000000000..f63557d8cf6 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.keystream differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.keystream.len new file mode 100644 index 00000000000..1fe2ce17931 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.keystream.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.len new file mode 100644 index 00000000000..5c576423938 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.values.at new file mode 100644 index 00000000000..79e307948f7 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.values.at differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab_i b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab_i new file mode 100644 index 00000000000..0dd970c4c01 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab_i differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab_i.len new file mode 100644 index 00000000000..131e265740f Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab_i.len differ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/last-build.bin b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/last-build.bin new file mode 100644 index 00000000000..ced6aa0ca79 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/last-build.bin differ diff --git a/samples/client/petstore/kotlin-jackson/docs/ApiResponse.md b/samples/client/petstore/kotlin-jackson/docs/ApiResponse.md new file mode 100644 index 00000000000..6b4c6bf2779 --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/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/client/petstore/kotlin-jackson/docs/Category.md b/samples/client/petstore/kotlin-jackson/docs/Category.md new file mode 100644 index 00000000000..2c28a670fc7 --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/docs/Category.md @@ -0,0 +1,11 @@ + +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**name** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/petstore/kotlin-jackson/docs/Order.md b/samples/client/petstore/kotlin-jackson/docs/Order.md new file mode 100644 index 00000000000..5112f08958d --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/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/client/petstore/kotlin-jackson/docs/Pet.md b/samples/client/petstore/kotlin-jackson/docs/Pet.md new file mode 100644 index 00000000000..70c340005d1 --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/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/client/petstore/kotlin-jackson/docs/PetApi.md b/samples/client/petstore/kotlin-jackson/docs/PetApi.md new file mode 100644 index 00000000000..ea93e174527 --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/docs/PetApi.md @@ -0,0 +1,405 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image + + + +# **addPet** +> addPet(body) + +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 body : Pet = // Pet | Pet object that needs to be added to the store +try { + apiInstance.addPet(body) +} 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 +------------- | ------------- | ------------- | ------------- + **body** | [**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(body) + +Update an existing pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val body : Pet = // Pet | Pet object that needs to be added to the store +try { + apiInstance.updatePet(body) +} 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 +------------- | ------------- | ------------- | ------------- + **body** | [**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 + diff --git a/samples/client/petstore/kotlin-jackson/docs/StoreApi.md b/samples/client/petstore/kotlin-jackson/docs/StoreApi.md new file mode 100644 index 00000000000..f4986041af8 --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/docs/StoreApi.md @@ -0,0 +1,196 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + + +# **deleteOrder** +> 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(body) + +Place an order for a pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val body : Order = // Order | order placed for purchasing the pet +try { + val result : Order = apiInstance.placeOrder(body) + 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 +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + diff --git a/samples/client/petstore/kotlin-jackson/docs/Tag.md b/samples/client/petstore/kotlin-jackson/docs/Tag.md new file mode 100644 index 00000000000..60ce1bcdbad --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/docs/Tag.md @@ -0,0 +1,11 @@ + +# Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**name** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/petstore/kotlin-jackson/docs/User.md b/samples/client/petstore/kotlin-jackson/docs/User.md new file mode 100644 index 00000000000..e801729b5ed --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/docs/User.md @@ -0,0 +1,17 @@ + +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**username** | **kotlin.String** | | [optional] +**firstName** | **kotlin.String** | | [optional] +**lastName** | **kotlin.String** | | [optional] +**email** | **kotlin.String** | | [optional] +**password** | **kotlin.String** | | [optional] +**phone** | **kotlin.String** | | [optional] +**userStatus** | **kotlin.Int** | User Status | [optional] + + + diff --git a/samples/client/petstore/kotlin-jackson/docs/UserApi.md b/samples/client/petstore/kotlin-jackson/docs/UserApi.md new file mode 100644 index 00000000000..0f55f06bc62 --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/docs/UserApi.md @@ -0,0 +1,376 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + + +# **createUser** +> createUser(body) + +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 body : User = // User | Created user object +try { + apiInstance.createUser(body) +} 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 +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| Created user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(body) + +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 body : kotlin.Array = // kotlin.Array | List of user object +try { + apiInstance.createUsersWithArrayInput(body) +} 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 +------------- | ------------- | ------------- | ------------- + **body** | [**kotlin.Array<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **createUsersWithListInput** +> createUsersWithListInput(body) + +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 body : kotlin.Array = // kotlin.Array | List of user object +try { + apiInstance.createUsersWithListInput(body) +} 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 +------------- | ------------- | ------------- | ------------- + **body** | [**kotlin.Array<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **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, body) + +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 body : User = // User | Updated user object +try { + apiInstance.updateUser(username, body) +} 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 | + **body** | [**User**](User.md)| Updated user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + diff --git a/samples/client/petstore/kotlin-jackson/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-jackson/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000000..87b738cbd05 Binary files /dev/null and b/samples/client/petstore/kotlin-jackson/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-jackson/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-jackson/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000000..7dc503f149d --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-jackson/gradlew b/samples/client/petstore/kotlin-jackson/gradlew new file mode 100755 index 00000000000..af6708ff229 --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jackson/gradlew.bat b/samples/client/petstore/kotlin-jackson/gradlew.bat new file mode 100644 index 00000000000..6d57edc706c --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/samples/client/petstore/kotlin-jackson/settings.gradle b/samples/client/petstore/kotlin-jackson/settings.gradle new file mode 100644 index 00000000000..28e8da587f0 --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/settings.gradle @@ -0,0 +1,2 @@ + +rootProject.name = 'kotlin-petstore-jackson' \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/Application.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/Application.kt new file mode 100644 index 00000000000..81e53e2d2f6 --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/Application.kt @@ -0,0 +1,20 @@ +package org.openapitools + +import org.openapitools.client.apis.PetApi +import org.openapitools.client.apis.StoreApi +import org.openapitools.client.models.Category +import org.openapitools.client.models.Pet +import org.openapitools.client.models.Tag + +fun main() { + println(".main") + val inventory = StoreApi().getInventory() + println("Inventory : $inventory") + val pet = Pet(name = "Elliot", photoUrls = listOf("https://jameshooverstudios.com/wp-content/uploads/2015/04/Majestic-Dog-Photography-Elliot-Nov-5-2014.jpg", "https://express-images.franklymedia.com/6616/sites/981/2020/01/22105725/Elliott.jpg").toTypedArray(), id = 123456453, category = Category(id = 13259476, name = "dog"), tags = listOf(Tag(id = 194093, name = "Elliot")).toTypedArray(), status = Pet.Status.AVAILABLE) + PetApi().addPet(pet) + val elliot = PetApi().getPetById(123456453) + println("Elliot : $elliot") + assert(pet == elliot) + println(".main") + +} diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt new file mode 100644 index 00000000000..2e3b24ae2ea --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -0,0 +1,366 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.apis + +import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.Pet + +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue + +class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiClient(basePath) { + + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun addPet(body: Pet) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/pet", + 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) + } + } + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf("api_key" to apiKey.toString()) + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), + 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) + } + } + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @return kotlin.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>() + .apply { + put("status", toMultiValue(status.toList(), "csv")) + } + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/pet/findByStatus", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request>( + localVariableConfig, + localVariableBody + ) + + 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 -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @return kotlin.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>() + .apply { + put("tags", toMultiValue(tags.toList(), "csv")) + } + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/pet/findByTags", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request>( + localVariableConfig, + localVariableBody + ) + + 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 -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return Pet + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getPetById(petId: kotlin.Long) : Pet { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Pet + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePet(body: Pet) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.PUT, + "/pet", + 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) + } + } + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { + val localVariableBody: kotlin.Any? = mapOf("name" to "$name", "status" to "$status") + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), + 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) + } + } + } + + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ApiResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { + val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to "$additionalMetadata", "file" to "$file") + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + +} diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt new file mode 100644 index 00000000000..1399a0ca1cf --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -0,0 +1,192 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.apis + +import org.openapitools.client.models.Order + +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue + +class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiClient(basePath) { + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @return 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() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), + 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) + } + } + } + + /** + * 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() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/store/inventory", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request>( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @return Order + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getOrderById(orderId: kotlin.Long) : Order { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Order + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet + * @return Order + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun placeOrder(body: Order) : Order { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/store/order", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Order + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + +} diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt new file mode 100644 index 00000000000..a7d99762fd8 --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -0,0 +1,357 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.apis + +import org.openapitools.client.models.User + +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue + +class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiClient(basePath) { + + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUser(body: User) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/user", + 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) + } + } + } + + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithArrayInput(body: kotlin.Array) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/user/createWithArray", + 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) + } + } + } + + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithListInput(body: kotlin.Array) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/user/createWithList", + 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) + } + } + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteUser(username: kotlin.String) : Unit { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.DELETE, + "/user/{username}".replace("{"+"username"+"}", "$username"), + 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) + } + } + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return User + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getUserByName(username: kotlin.String) : User { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/user/{username}".replace("{"+"username"+"}", "$username"), + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as User + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return kotlin.String + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { + val localVariableBody: kotlin.Any? = null + val localVariableQuery: MultiValueMap = mutableMapOf>() + .apply { + put("username", listOf(username.toString())) + put("password", listOf(password.toString())) + } + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/user/login", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * 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() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/user/logout", + 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) + } + } + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updateUser(username: kotlin.String, body: User) : Unit { + val localVariableBody: kotlin.Any? = body + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + val localVariableConfig = RequestConfig( + RequestMethod.PUT, + "/user/{username}".replace("{"+"username"+"}", "$username"), + 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) + } + } + } + +} diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt new file mode 100644 index 00000000000..ef7a8f1e1a6 --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -0,0 +1,23 @@ +package org.openapitools.client.infrastructure + +typealias MultiValueMap = MutableMap> + +fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { + "csv" -> "," + "tsv" -> "\t" + "pipe" -> "|" + "space" -> " " + else -> "" +} + +val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } + +fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) + = toMultiValue(items.asIterable(), collectionFormat, map) + +fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { + return when(collectionFormat) { + "multi" -> items.map(map) + else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt new file mode 100644 index 00000000000..3047834f4ef --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -0,0 +1,175 @@ +package org.openapitools.client.infrastructure + +import okhttp3.Credentials +import okhttp3.OkHttpClient +import okhttp3.RequestBody +import okhttp3.RequestBody.Companion.asRequestBody +import okhttp3.RequestBody.Companion.toRequestBody +import okhttp3.FormBody +import okhttp3.HttpUrl.Companion.toHttpUrlOrNull +import okhttp3.ResponseBody +import okhttp3.MediaType.Companion.toMediaTypeOrNull +import okhttp3.Request +import java.io.File + +open class ApiClient(val baseUrl: String) { + companion object { + protected const val ContentType = "Content-Type" + protected const val Accept = "Accept" + protected const val Authorization = "Authorization" + protected const val JsonMediaType = "application/json" + protected const val FormDataMediaType = "multipart/form-data" + protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" + protected const val XmlMediaType = "application/xml" + + val apiKey: MutableMap = mutableMapOf() + val apiKeyPrefix: MutableMap = mutableMapOf() + var username: String? = null + var password: String? = null + var accessToken: String? = null + + @JvmStatic + val client: OkHttpClient by lazy { + builder.build() + } + + @JvmStatic + val builder: OkHttpClient.Builder = OkHttpClient.Builder() + } + + protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = + when { + content is File -> content.asRequestBody( + mediaType.toMediaTypeOrNull() + ) + mediaType == FormDataMediaType || mediaType == FormUrlEncMediaType -> { + FormBody.Builder().apply { + // content's type *must* be Map + @Suppress("UNCHECKED_CAST") + (content as Map).forEach { (key, value) -> + add(key, value) + } + }.build() + } + mediaType == JsonMediaType -> Serializer.jacksonObjectMapper.writeValueAsString(content).toRequestBody( + mediaType.toMediaTypeOrNull() + ) + mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") + // TODO: this should be extended with other serializers + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") + } + + protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + if(body == null) { + return null + } + val bodyContent = body.string() + if (bodyContent.isEmpty()) { + return null + } + return when(mediaType) { + JsonMediaType -> Serializer.jacksonObjectMapper.readValue(bodyContent, T::class.java) + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + } + } + + protected fun updateAuthParams(requestConfig: RequestConfig) { + if (requestConfig.headers["api_key"].isNullOrEmpty()) { + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! + } else { + requestConfig.headers["api_key"] = apiKey["api_key"]!! + } + } + } + if (requestConfig.headers[Authorization].isNullOrEmpty()) { + accessToken?.let { accessToken -> + requestConfig.headers[Authorization] = "Bearer $accessToken " + } + } + } + + protected inline fun request(requestConfig: RequestConfig, body : Any? = null): ApiInfrastructureResponse { + val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") + + // take authMethod from operation + updateAuthParams(requestConfig) + + val url = httpUrl.newBuilder() + .addPathSegments(requestConfig.path.trimStart('/')) + .apply { + requestConfig.query.forEach { query -> + query.value.forEach { queryValue -> + addQueryParameter(query.key, queryValue) + } + } + }.build() + + // take content-type/accept from spec or set to default (application/json) if not defined + if (requestConfig.headers[ContentType].isNullOrEmpty()) { + requestConfig.headers[ContentType] = JsonMediaType + } + if (requestConfig.headers[Accept].isNullOrEmpty()) { + requestConfig.headers[Accept] = JsonMediaType + } + val headers = requestConfig.headers + + if(headers[ContentType] ?: "" == "") { + throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") + } + + if(headers[Accept] ?: "" == "") { + throw kotlin.IllegalStateException("Missing Accept header. This is required.") + } + + // TODO: support multiple contentType options here. + val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() + + val request = when (requestConfig.method) { + RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(body, contentType)) + RequestMethod.GET -> Request.Builder().url(url) + RequestMethod.HEAD -> Request.Builder().url(url).head() + RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(body, contentType)) + RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(body, contentType)) + RequestMethod.POST -> Request.Builder().url(url).post(requestBody(body, contentType)) + RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) + }.apply { + headers.forEach { header -> addHeader(header.key, header.value) } + }.build() + + val response = client.newCall(request).execute() + val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() + + // TODO: handle specific mapping types. e.g. Map> + when { + response.isRedirect -> return Redirection( + response.code, + response.headers.toMultimap() + ) + response.isInformational -> return Informational( + response.message, + response.code, + response.headers.toMultimap() + ) + response.isSuccessful -> return Success( + responseBody(response.body, accept), + response.code, + response.headers.toMultimap() + ) + response.isClientError -> return ClientError( + response.message, + response.body?.string(), + response.code, + response.headers.toMultimap() + ) + else -> return ServerError( + response.message, + response.body?.string(), + response.code, + response.headers.toMultimap() + ) + } + } + +} diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt new file mode 100644 index 00000000000..9dc8d8dbbfa --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { + abstract val statusCode: Int + abstract val headers: Map> +} + +class Success( + val data: T, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +): ApiInfrastructureResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiInfrastructureResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiInfrastructureResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiInfrastructureResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt new file mode 100644 index 00000000000..dd34bd48b2c --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt @@ -0,0 +1,29 @@ +package org.openapitools.client.infrastructure + +import kotlin.properties.ReadWriteProperty +import kotlin.reflect.KProperty + +object ApplicationDelegates { + /** + * Provides a property delegate, allowing the property to be set once and only once. + * + * If unset (no default value), a get on the property will throw [IllegalStateException]. + */ + fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) + + private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { + private var isSet = false + private var value: T? = defaultValue + + override fun getValue(thisRef: Any?, property: KProperty<*>): T { + return value ?: throw IllegalStateException("${property.name} not initialized") + } + + override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { + if (!isSet) { + this.value = value + isSet = true + } + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt new file mode 100644 index 00000000000..fff39c7ac24 --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -0,0 +1,3 @@ +package org.openapitools.client.infrastructure + + diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt new file mode 100644 index 00000000000..b5310e71f13 --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt @@ -0,0 +1,18 @@ +@file:Suppress("unused") +package org.openapitools.client.infrastructure + +import java.lang.RuntimeException + +open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { + + companion object { + private const val serialVersionUID: Long = 123L + } +} + +open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { + + companion object { + private const val serialVersionUID: Long = 456L + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt new file mode 100644 index 00000000000..9c22257e223 --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt @@ -0,0 +1,16 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given request. + * NOTE: This object doesn't include 'body' because it + * allows for caching of the constructed object + * for many request definitions. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class RequestConfig( + val method: RequestMethod, + val path: String, + val headers: MutableMap = mutableMapOf(), + val query: MutableMap> = mutableMapOf() +) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt new file mode 100644 index 00000000000..931b12b8bd7 --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt @@ -0,0 +1,8 @@ +package org.openapitools.client.infrastructure + +/** + * Provides enumerated HTTP verbs + */ +enum class RequestMethod { + GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt new file mode 100644 index 00000000000..69b562becb0 --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt @@ -0,0 +1,23 @@ +package org.openapitools.client.infrastructure + +import okhttp3.Response + +/** + * Provides an extension to evaluation whether the response is a 1xx code + */ +val Response.isInformational : Boolean get() = this.code in 100..199 + +/** + * Provides an extension to evaluation whether the response is a 3xx code + */ +val Response.isRedirect : Boolean get() = this.code in 300..399 + +/** + * Provides an extension to evaluation whether the response is a 4xx code + */ +val Response.isClientError : Boolean get() = this.code in 400..499 + +/** + * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code + */ +val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt new file mode 100644 index 00000000000..78e749b7a61 --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -0,0 +1,16 @@ +package org.openapitools.client.infrastructure + +import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.datatype.jdk8.Jdk8Module +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule +import com.fasterxml.jackson.annotation.JsonInclude +import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper +import java.util.Date + +object Serializer { + @JvmStatic + val jacksonObjectMapper: ObjectMapper = jacksonObjectMapper() + .registerModule(Jdk8Module()) + .registerModule(JavaTimeModule()) + .setSerializationInclusion(JsonInclude.Include.NON_ABSENT) +} diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt new file mode 100644 index 00000000000..b63a6071bfc --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -0,0 +1,35 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.annotation.JsonFormat +/** + * Describes the result of uploading an image resource + * @param code + * @param type + * @param message + */ + +data class ApiResponse ( + @JsonProperty("code") + val code: kotlin.Int? = null +, + @JsonProperty("type") + val type: kotlin.String? = null +, + @JsonProperty("message") + val message: kotlin.String? = null + +) + diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt new file mode 100644 index 00000000000..cc13aeec229 --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.annotation.JsonFormat +/** + * A category for a pet + * @param id + * @param name + */ + +data class Category ( + @JsonProperty("id") + val id: kotlin.Long? = null +, + @JsonProperty("name") + val name: kotlin.String? = null + +) + 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 new file mode 100644 index 00000000000..7988c3fcd7b --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -0,0 +1,63 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.annotation.JsonFormat +/** + * An order for a pets from the pet store + * @param id + * @param petId + * @param quantity + * @param shipDate + * @param status Order Status + * @param complete + */ + +data class Order ( + @JsonProperty("id") + val id: kotlin.Long? = null +, + @JsonProperty("petId") + val petId: kotlin.Long? = null +, + @JsonProperty("quantity") + val quantity: kotlin.Int? = null +, + @JsonFormat + (shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy hh:mm:ss") + @JsonProperty("shipDate") + val shipDate: java.time.OffsetDateTime? = null +, + /* Order Status */ + @JsonProperty("status") + val status: Order.Status? = null +, + @JsonProperty("complete") + val complete: kotlin.Boolean? = null + +) { + + /** + * Order Status + * Values: PLACED,APPROVED,DELIVERED + */ + + @JsonFormat(shape = JsonFormat.Shape.NATURAL) + enum class Status(val value: kotlin.String){ + @JsonProperty(value="placed") PLACED("placed"), + @JsonProperty(value="approved") APPROVED("approved"), + @JsonProperty(value="delivered") DELIVERED("delivered"); + } +} + diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt new file mode 100644 index 00000000000..29cf96ba4aa --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -0,0 +1,63 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.Category +import org.openapitools.client.models.Tag + +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.annotation.JsonFormat +/** + * A pet for sale in the pet store + * @param name + * @param photoUrls + * @param id + * @param category + * @param tags + * @param status pet status in the store + */ + +data class Pet ( + @JsonProperty("name") + val name: kotlin.String +, + @JsonProperty("photoUrls") + val photoUrls: kotlin.Array +, + @JsonProperty("id") + val id: kotlin.Long? = null +, + @JsonProperty("category") + val category: Category? = null +, + @JsonProperty("tags") + val tags: kotlin.Array? = null +, + /* pet status in the store */ + @JsonProperty("status") + val status: Pet.Status? = null + +) { + + /** + * pet status in the store + * Values: AVAILABLE,PENDING,SOLD + */ + + @JsonFormat(shape = JsonFormat.Shape.NATURAL) + enum class Status(val value: kotlin.String){ + @JsonProperty(value="available") AVAILABLE("available"), + @JsonProperty(value="pending") PENDING("pending"), + @JsonProperty(value="sold") SOLD("sold"); + } +} + diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt new file mode 100644 index 00000000000..3a734b01812 --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.annotation.JsonFormat +/** + * A tag for a pet + * @param id + * @param name + */ + +data class Tag ( + @JsonProperty("id") + val id: kotlin.Long? = null +, + @JsonProperty("name") + val name: kotlin.String? = null + +) + diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/User.kt new file mode 100644 index 00000000000..4fd3fe74ae3 --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/User.kt @@ -0,0 +1,56 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.annotation.JsonFormat +/** + * A User who is purchasing from the pet store + * @param id + * @param username + * @param firstName + * @param lastName + * @param email + * @param password + * @param phone + * @param userStatus User Status + */ + +data class User ( + @JsonProperty("id") + val id: kotlin.Long? = null +, + @JsonProperty("username") + val username: kotlin.String? = null +, + @JsonProperty("firstName") + val firstName: kotlin.String? = null +, + @JsonProperty("lastName") + val lastName: kotlin.String? = null +, + @JsonProperty("email") + val email: kotlin.String? = null +, + @JsonProperty("password") + val password: kotlin.String? = null +, + @JsonProperty("phone") + val phone: kotlin.String? = null +, + /* User Status */ + @JsonProperty("userStatus") + val userStatus: kotlin.Int? = null + +) + diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index d56cfcc2a32..feb9aeebbf6 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -85,7 +85,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 " } } } diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index ada15fee7a1..5078a38f945 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -22,10 +22,13 @@ import com.squareup.moshi.Json data class ApiResponse ( @Json(name = "code") - val code: kotlin.Int? = null, + val code: kotlin.Int? = null +, @Json(name = "type") - val type: kotlin.String? = null, + val type: kotlin.String? = null +, @Json(name = "message") val message: kotlin.String? = null + ) diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Category.kt index 426a0e51592..5473b36a379 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -21,8 +21,10 @@ import com.squareup.moshi.Json data class Category ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "name") val name: kotlin.String? = null + ) diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Order.kt index 3cfa5ca9626..f59f4a0cd97 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -25,18 +25,24 @@ import com.squareup.moshi.Json data class Order ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "petId") - val petId: kotlin.Long? = null, + val petId: kotlin.Long? = null +, @Json(name = "quantity") - val quantity: kotlin.Int? = null, + val quantity: kotlin.Int? = null +, @Json(name = "shipDate") - val shipDate: java.time.OffsetDateTime? = null, + val shipDate: java.time.OffsetDateTime? = null +, /* Order Status */ @Json(name = "status") - val status: Order.Status? = null, + val status: Order.Status? = null +, @Json(name = "complete") val complete: kotlin.Boolean? = null + ) { /** @@ -44,6 +50,7 @@ data class Order ( * Values: placed,approved,delivered */ + enum class Status(val value: kotlin.String){ @Json(name = "placed") placed("placed"), @Json(name = "approved") approved("approved"), diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Pet.kt index a94bb811c3b..9830ead3359 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -27,18 +27,24 @@ import com.squareup.moshi.Json data class Pet ( @Json(name = "name") - val name: kotlin.String, + val name: kotlin.String +, @Json(name = "photoUrls") - val photoUrls: kotlin.Array, + val photoUrls: kotlin.Array +, @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "category") - val category: Category? = null, + val category: Category? = null +, @Json(name = "tags") - val tags: kotlin.Array? = null, + val tags: kotlin.Array? = null +, /* pet status in the store */ @Json(name = "status") val status: Pet.Status? = null + ) { /** @@ -46,6 +52,7 @@ data class Pet ( * Values: available,pending,sold */ + enum class Status(val value: kotlin.String){ @Json(name = "available") available("available"), @Json(name = "pending") pending("pending"), diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Tag.kt index f9ef87e13fb..ccdd4390d1a 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -21,8 +21,10 @@ import com.squareup.moshi.Json data class Tag ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "name") val name: kotlin.String? = null + ) diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/User.kt index dfd63806da9..e2679988c51 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/User.kt @@ -27,21 +27,29 @@ import com.squareup.moshi.Json data class User ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "username") - val username: kotlin.String? = null, + val username: kotlin.String? = null +, @Json(name = "firstName") - val firstName: kotlin.String? = null, + val firstName: kotlin.String? = null +, @Json(name = "lastName") - val lastName: kotlin.String? = null, + val lastName: kotlin.String? = null +, @Json(name = "email") - val email: kotlin.String? = null, + val email: kotlin.String? = null +, @Json(name = "password") - val password: kotlin.String? = null, + val password: kotlin.String? = null +, @Json(name = "phone") - val phone: kotlin.String? = null, + val phone: kotlin.String? = null +, /* User Status */ @Json(name = "userStatus") val userStatus: kotlin.Int? = null + ) diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index a03ba02ff08..5d3ecd7b31f 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -85,7 +85,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 " } } } diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index 25f8ffdf473..d8890d11809 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -23,10 +23,13 @@ import com.squareup.moshi.JsonClass @JsonClass(generateAdapter = true) data class ApiResponse ( @Json(name = "code") - val code: kotlin.Int? = null, + val code: kotlin.Int? = null +, @Json(name = "type") - val type: kotlin.String? = null, + val type: kotlin.String? = null +, @Json(name = "message") val message: kotlin.String? = null + ) diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Category.kt index e7229ac4384..c67a0e8183a 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -22,8 +22,10 @@ import com.squareup.moshi.JsonClass @JsonClass(generateAdapter = true) data class Category ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "name") val name: kotlin.String? = null + ) diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Order.kt index c408adac995..7bbad38f98e 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -26,18 +26,24 @@ import com.squareup.moshi.JsonClass @JsonClass(generateAdapter = true) data class Order ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "petId") - val petId: kotlin.Long? = null, + val petId: kotlin.Long? = null +, @Json(name = "quantity") - val quantity: kotlin.Int? = null, + val quantity: kotlin.Int? = null +, @Json(name = "shipDate") - val shipDate: java.time.OffsetDateTime? = null, + val shipDate: java.time.OffsetDateTime? = null +, /* Order Status */ @Json(name = "status") - val status: Order.Status? = null, + val status: Order.Status? = null +, @Json(name = "complete") val complete: kotlin.Boolean? = null + ) { /** @@ -45,6 +51,7 @@ data class Order ( * Values: placed,approved,delivered */ + enum class Status(val value: kotlin.String){ @Json(name = "placed") placed("placed"), @Json(name = "approved") approved("approved"), diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Pet.kt index abba68a0646..418dbfe6d43 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -28,18 +28,24 @@ import com.squareup.moshi.JsonClass @JsonClass(generateAdapter = true) data class Pet ( @Json(name = "name") - val name: kotlin.String, + val name: kotlin.String +, @Json(name = "photoUrls") - val photoUrls: kotlin.Array, + val photoUrls: kotlin.Array +, @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "category") - val category: Category? = null, + val category: Category? = null +, @Json(name = "tags") - val tags: kotlin.Array? = null, + val tags: kotlin.Array? = null +, /* pet status in the store */ @Json(name = "status") val status: Pet.Status? = null + ) { /** @@ -47,6 +53,7 @@ data class Pet ( * Values: available,pending,sold */ + enum class Status(val value: kotlin.String){ @Json(name = "available") available("available"), @Json(name = "pending") pending("pending"), diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Tag.kt index c1da1f74c35..53edcc1e32a 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -22,8 +22,10 @@ import com.squareup.moshi.JsonClass @JsonClass(generateAdapter = true) data class Tag ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "name") val name: kotlin.String? = null + ) diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/User.kt index 3d9ab220849..508a629f3d7 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/User.kt @@ -28,21 +28,29 @@ import com.squareup.moshi.JsonClass @JsonClass(generateAdapter = true) data class User ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "username") - val username: kotlin.String? = null, + val username: kotlin.String? = null +, @Json(name = "firstName") - val firstName: kotlin.String? = null, + val firstName: kotlin.String? = null +, @Json(name = "lastName") - val lastName: kotlin.String? = null, + val lastName: kotlin.String? = null +, @Json(name = "email") - val email: kotlin.String? = null, + val email: kotlin.String? = null +, @Json(name = "password") - val password: kotlin.String? = null, + val password: kotlin.String? = null +, @Json(name = "phone") - val phone: kotlin.String? = null, + val phone: kotlin.String? = null +, /* User Status */ @Json(name = "userStatus") val userStatus: kotlin.Int? = null + ) diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt index 51ab6ed9398..6b684f257f3 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -22,8 +22,11 @@ import kotlinx.serialization.internal.CommonEnumSerializer */ @Serializable data class ApiResponse ( - @SerialName(value = "code") val code: kotlin.Int? = null, - @SerialName(value = "type") val type: kotlin.String? = null, + @SerialName(value = "code") val code: kotlin.Int? = null +, + @SerialName(value = "type") val type: kotlin.String? = null +, @SerialName(value = "message") val message: kotlin.String? = null + ) diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt index 96432c658ad..4dc3a47adc5 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt @@ -21,7 +21,9 @@ import kotlinx.serialization.internal.CommonEnumSerializer */ @Serializable data class Category ( - @SerialName(value = "id") val id: kotlin.Long? = null, + @SerialName(value = "id") val id: kotlin.Long? = null +, @SerialName(value = "name") val name: kotlin.String? = null + ) diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt index ec1a0d28e31..0c4b93729ea 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt @@ -25,13 +25,19 @@ import kotlinx.serialization.internal.CommonEnumSerializer */ @Serializable data class Order ( - @SerialName(value = "id") val id: kotlin.Long? = null, - @SerialName(value = "petId") val petId: kotlin.Long? = null, - @SerialName(value = "quantity") val quantity: kotlin.Int? = null, - @SerialName(value = "shipDate") val shipDate: kotlin.String? = null, + @SerialName(value = "id") val id: kotlin.Long? = null +, + @SerialName(value = "petId") val petId: kotlin.Long? = null +, + @SerialName(value = "quantity") val quantity: kotlin.Int? = null +, + @SerialName(value = "shipDate") val shipDate: kotlin.String? = null +, /* Order Status */ - @SerialName(value = "status") val status: Order.Status? = null, + @SerialName(value = "status") val status: Order.Status? = null +, @SerialName(value = "complete") val complete: kotlin.Boolean? = null + ) { /** @@ -39,6 +45,7 @@ data class Order ( * Values: placed,approved,delivered */ @Serializable(with = Status.Serializer::class) + enum class Status(val value: kotlin.String){ placed("placed"), approved("approved"), diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt index 5e33d005670..1db71795874 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt @@ -27,13 +27,19 @@ import kotlinx.serialization.internal.CommonEnumSerializer */ @Serializable data class Pet ( - @SerialName(value = "name") @Required val name: kotlin.String, - @SerialName(value = "photoUrls") @Required val photoUrls: kotlin.Array, - @SerialName(value = "id") val id: kotlin.Long? = null, - @SerialName(value = "category") val category: Category? = null, - @SerialName(value = "tags") val tags: kotlin.Array? = null, + @SerialName(value = "name") @Required val name: kotlin.String +, + @SerialName(value = "photoUrls") @Required val photoUrls: kotlin.Array +, + @SerialName(value = "id") val id: kotlin.Long? = null +, + @SerialName(value = "category") val category: Category? = null +, + @SerialName(value = "tags") val tags: kotlin.Array? = null +, /* pet status in the store */ @SerialName(value = "status") val status: Pet.Status? = null + ) { /** @@ -41,6 +47,7 @@ data class Pet ( * Values: available,pending,sold */ @Serializable(with = Status.Serializer::class) + enum class Status(val value: kotlin.String){ available("available"), pending("pending"), diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt index b21e51bf8d3..3b46b296966 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt @@ -21,7 +21,9 @@ import kotlinx.serialization.internal.CommonEnumSerializer */ @Serializable data class Tag ( - @SerialName(value = "id") val id: kotlin.Long? = null, + @SerialName(value = "id") val id: kotlin.Long? = null +, @SerialName(value = "name") val name: kotlin.String? = null + ) diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt index 7d52e737d49..abc7a209225 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt @@ -27,14 +27,22 @@ import kotlinx.serialization.internal.CommonEnumSerializer */ @Serializable data class User ( - @SerialName(value = "id") val id: kotlin.Long? = null, - @SerialName(value = "username") val username: kotlin.String? = null, - @SerialName(value = "firstName") val firstName: kotlin.String? = null, - @SerialName(value = "lastName") val lastName: kotlin.String? = null, - @SerialName(value = "email") val email: kotlin.String? = null, - @SerialName(value = "password") val password: kotlin.String? = null, - @SerialName(value = "phone") val phone: kotlin.String? = null, + @SerialName(value = "id") val id: kotlin.Long? = null +, + @SerialName(value = "username") val username: kotlin.String? = null +, + @SerialName(value = "firstName") val firstName: kotlin.String? = null +, + @SerialName(value = "lastName") val lastName: kotlin.String? = null +, + @SerialName(value = "email") val email: kotlin.String? = null +, + @SerialName(value = "password") val password: kotlin.String? = null +, + @SerialName(value = "phone") val phone: kotlin.String? = null +, /* User Status */ @SerialName(value = "userStatus") val userStatus: kotlin.Int? = null + ) diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 0055340ab35..c591f98d389 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -85,7 +85,7 @@ internal open class ApiClient(val baseUrl: String) { } if (requestConfig.headers[Authorization].isNullOrEmpty()) { accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer " + accessToken + requestConfig.headers[Authorization] = "Bearer $accessToken " } } } diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index 4a2f8b137cc..963fb9549b7 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -22,10 +22,13 @@ import com.squareup.moshi.Json internal data class ApiResponse ( @Json(name = "code") - val code: kotlin.Int? = null, + val code: kotlin.Int? = null +, @Json(name = "type") - val type: kotlin.String? = null, + val type: kotlin.String? = null +, @Json(name = "message") val message: kotlin.String? = null + ) diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Category.kt index 10d567d3c3c..46fb662642c 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -21,8 +21,10 @@ import com.squareup.moshi.Json internal data class Category ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "name") val name: kotlin.String? = null + ) diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Order.kt index 8a44803771b..cfa632c9d14 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -25,18 +25,24 @@ import com.squareup.moshi.Json internal data class Order ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "petId") - val petId: kotlin.Long? = null, + val petId: kotlin.Long? = null +, @Json(name = "quantity") - val quantity: kotlin.Int? = null, + val quantity: kotlin.Int? = null +, @Json(name = "shipDate") - val shipDate: java.time.OffsetDateTime? = null, + val shipDate: java.time.OffsetDateTime? = null +, /* Order Status */ @Json(name = "status") - val status: Order.Status? = null, + val status: Order.Status? = null +, @Json(name = "complete") val complete: kotlin.Boolean? = null + ) { /** @@ -44,6 +50,7 @@ internal data class Order ( * Values: placed,approved,delivered */ + internal enum class Status(val value: kotlin.String){ @Json(name = "placed") placed("placed"), @Json(name = "approved") approved("approved"), diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Pet.kt index fe63282fa21..34d343221a8 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -27,18 +27,24 @@ import com.squareup.moshi.Json internal data class Pet ( @Json(name = "name") - val name: kotlin.String, + val name: kotlin.String +, @Json(name = "photoUrls") - val photoUrls: kotlin.Array, + val photoUrls: kotlin.Array +, @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "category") - val category: Category? = null, + val category: Category? = null +, @Json(name = "tags") - val tags: kotlin.Array? = null, + val tags: kotlin.Array? = null +, /* pet status in the store */ @Json(name = "status") val status: Pet.Status? = null + ) { /** @@ -46,6 +52,7 @@ internal data class Pet ( * Values: available,pending,sold */ + internal enum class Status(val value: kotlin.String){ @Json(name = "available") available("available"), @Json(name = "pending") pending("pending"), diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Tag.kt index 2a130c6cd1d..09ed60fb047 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -21,8 +21,10 @@ import com.squareup.moshi.Json internal data class Tag ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "name") val name: kotlin.String? = null + ) diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/User.kt index afac563f29c..8c30ff1bbb2 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/User.kt @@ -27,21 +27,29 @@ import com.squareup.moshi.Json internal data class User ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "username") - val username: kotlin.String? = null, + val username: kotlin.String? = null +, @Json(name = "firstName") - val firstName: kotlin.String? = null, + val firstName: kotlin.String? = null +, @Json(name = "lastName") - val lastName: kotlin.String? = null, + val lastName: kotlin.String? = null +, @Json(name = "email") - val email: kotlin.String? = null, + val email: kotlin.String? = null +, @Json(name = "password") - val password: kotlin.String? = null, + val password: kotlin.String? = null +, @Json(name = "phone") - val phone: kotlin.String? = null, + val phone: kotlin.String? = null +, /* User Status */ @Json(name = "userStatus") val userStatus: kotlin.Int? = null + ) diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index a03ba02ff08..5d3ecd7b31f 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -85,7 +85,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 " } } } diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index eed5027e801..6ce6f25632f 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -23,11 +23,14 @@ import java.io.Serializable data class ApiResponse ( @Json(name = "code") - val code: kotlin.Int? = null, + val code: kotlin.Int? = null +, @Json(name = "type") - val type: kotlin.String? = null, + val type: kotlin.String? = null +, @Json(name = "message") val message: kotlin.String? = null + ) : Serializable { companion object { private const val serialVersionUID: Long = 123 diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Category.kt index f29e6833057..e8c1970031e 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -22,9 +22,11 @@ import java.io.Serializable data class Category ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "name") val name: kotlin.String? = null + ) : Serializable { companion object { private const val serialVersionUID: Long = 123 diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Order.kt index 2b92b4375d1..7c1523899ed 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -26,18 +26,24 @@ import java.io.Serializable data class Order ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "petId") - val petId: kotlin.Long? = null, + val petId: kotlin.Long? = null +, @Json(name = "quantity") - val quantity: kotlin.Int? = null, + val quantity: kotlin.Int? = null +, @Json(name = "shipDate") - val shipDate: java.time.OffsetDateTime? = null, + val shipDate: java.time.OffsetDateTime? = null +, /* Order Status */ @Json(name = "status") - val status: Order.Status? = null, + val status: Order.Status? = null +, @Json(name = "complete") val complete: kotlin.Boolean? = null + ) : Serializable { companion object { private const val serialVersionUID: Long = 123 @@ -48,6 +54,7 @@ data class Order ( * Values: placed,approved,delivered */ + enum class Status(val value: kotlin.String){ @Json(name = "placed") placed("placed"), @Json(name = "approved") approved("approved"), diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Pet.kt index bb0a5df6e19..09ce86f9be4 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -28,18 +28,24 @@ import java.io.Serializable data class Pet ( @Json(name = "name") - val name: kotlin.String, + val name: kotlin.String +, @Json(name = "photoUrls") - val photoUrls: kotlin.Array, + val photoUrls: kotlin.Array +, @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "category") - val category: Category? = null, + val category: Category? = null +, @Json(name = "tags") - val tags: kotlin.Array? = null, + val tags: kotlin.Array? = null +, /* pet status in the store */ @Json(name = "status") val status: Pet.Status? = null + ) : Serializable { companion object { private const val serialVersionUID: Long = 123 @@ -50,6 +56,7 @@ data class Pet ( * Values: available,pending,sold */ + enum class Status(val value: kotlin.String){ @Json(name = "available") available("available"), @Json(name = "pending") pending("pending"), diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Tag.kt index aa93e435695..4b36614f2fd 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -22,9 +22,11 @@ import java.io.Serializable data class Tag ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "name") val name: kotlin.String? = null + ) : Serializable { companion object { private const val serialVersionUID: Long = 123 diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/User.kt index 7487ed927d1..e256026ee90 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/User.kt @@ -28,22 +28,30 @@ import java.io.Serializable data class User ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "username") - val username: kotlin.String? = null, + val username: kotlin.String? = null +, @Json(name = "firstName") - val firstName: kotlin.String? = null, + val firstName: kotlin.String? = null +, @Json(name = "lastName") - val lastName: kotlin.String? = null, + val lastName: kotlin.String? = null +, @Json(name = "email") - val email: kotlin.String? = null, + val email: kotlin.String? = null +, @Json(name = "password") - val password: kotlin.String? = null, + val password: kotlin.String? = null +, @Json(name = "phone") - val phone: kotlin.String? = null, + val phone: kotlin.String? = null +, /* User Status */ @Json(name = "userStatus") val userStatus: kotlin.Int? = null + ) : Serializable { companion object { private const val serialVersionUID: Long = 123 diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 2669e67f34f..1588da740d4 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -83,7 +83,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 " } } } diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index ada15fee7a1..5078a38f945 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -22,10 +22,13 @@ import com.squareup.moshi.Json data class ApiResponse ( @Json(name = "code") - val code: kotlin.Int? = null, + val code: kotlin.Int? = null +, @Json(name = "type") - val type: kotlin.String? = null, + val type: kotlin.String? = null +, @Json(name = "message") val message: kotlin.String? = null + ) diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Category.kt index 426a0e51592..5473b36a379 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -21,8 +21,10 @@ import com.squareup.moshi.Json data class Category ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "name") val name: kotlin.String? = null + ) diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Order.kt index 3cfa5ca9626..f59f4a0cd97 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -25,18 +25,24 @@ import com.squareup.moshi.Json data class Order ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "petId") - val petId: kotlin.Long? = null, + val petId: kotlin.Long? = null +, @Json(name = "quantity") - val quantity: kotlin.Int? = null, + val quantity: kotlin.Int? = null +, @Json(name = "shipDate") - val shipDate: java.time.OffsetDateTime? = null, + val shipDate: java.time.OffsetDateTime? = null +, /* Order Status */ @Json(name = "status") - val status: Order.Status? = null, + val status: Order.Status? = null +, @Json(name = "complete") val complete: kotlin.Boolean? = null + ) { /** @@ -44,6 +50,7 @@ data class Order ( * Values: placed,approved,delivered */ + enum class Status(val value: kotlin.String){ @Json(name = "placed") placed("placed"), @Json(name = "approved") approved("approved"), diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Pet.kt index a94bb811c3b..9830ead3359 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -27,18 +27,24 @@ import com.squareup.moshi.Json data class Pet ( @Json(name = "name") - val name: kotlin.String, + val name: kotlin.String +, @Json(name = "photoUrls") - val photoUrls: kotlin.Array, + val photoUrls: kotlin.Array +, @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "category") - val category: Category? = null, + val category: Category? = null +, @Json(name = "tags") - val tags: kotlin.Array? = null, + val tags: kotlin.Array? = null +, /* pet status in the store */ @Json(name = "status") val status: Pet.Status? = null + ) { /** @@ -46,6 +52,7 @@ data class Pet ( * Values: available,pending,sold */ + enum class Status(val value: kotlin.String){ @Json(name = "available") available("available"), @Json(name = "pending") pending("pending"), diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Tag.kt index f9ef87e13fb..ccdd4390d1a 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -21,8 +21,10 @@ import com.squareup.moshi.Json data class Tag ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "name") val name: kotlin.String? = null + ) diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/User.kt index dfd63806da9..e2679988c51 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/User.kt @@ -27,21 +27,29 @@ import com.squareup.moshi.Json data class User ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "username") - val username: kotlin.String? = null, + val username: kotlin.String? = null +, @Json(name = "firstName") - val firstName: kotlin.String? = null, + val firstName: kotlin.String? = null +, @Json(name = "lastName") - val lastName: kotlin.String? = null, + val lastName: kotlin.String? = null +, @Json(name = "email") - val email: kotlin.String? = null, + val email: kotlin.String? = null +, @Json(name = "password") - val password: kotlin.String? = null, + val password: kotlin.String? = null +, @Json(name = "phone") - val phone: kotlin.String? = null, + val phone: kotlin.String? = null +, /* User Status */ @Json(name = "userStatus") val userStatus: kotlin.Int? = null + ) diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index ada15fee7a1..5078a38f945 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -22,10 +22,13 @@ import com.squareup.moshi.Json data class ApiResponse ( @Json(name = "code") - val code: kotlin.Int? = null, + val code: kotlin.Int? = null +, @Json(name = "type") - val type: kotlin.String? = null, + val type: kotlin.String? = null +, @Json(name = "message") val message: kotlin.String? = null + ) diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Category.kt index 426a0e51592..5473b36a379 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -21,8 +21,10 @@ import com.squareup.moshi.Json data class Category ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "name") val name: kotlin.String? = null + ) diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Order.kt index 3cfa5ca9626..f59f4a0cd97 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -25,18 +25,24 @@ import com.squareup.moshi.Json data class Order ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "petId") - val petId: kotlin.Long? = null, + val petId: kotlin.Long? = null +, @Json(name = "quantity") - val quantity: kotlin.Int? = null, + val quantity: kotlin.Int? = null +, @Json(name = "shipDate") - val shipDate: java.time.OffsetDateTime? = null, + val shipDate: java.time.OffsetDateTime? = null +, /* Order Status */ @Json(name = "status") - val status: Order.Status? = null, + val status: Order.Status? = null +, @Json(name = "complete") val complete: kotlin.Boolean? = null + ) { /** @@ -44,6 +50,7 @@ data class Order ( * Values: placed,approved,delivered */ + enum class Status(val value: kotlin.String){ @Json(name = "placed") placed("placed"), @Json(name = "approved") approved("approved"), diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Pet.kt index a94bb811c3b..9830ead3359 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -27,18 +27,24 @@ import com.squareup.moshi.Json data class Pet ( @Json(name = "name") - val name: kotlin.String, + val name: kotlin.String +, @Json(name = "photoUrls") - val photoUrls: kotlin.Array, + val photoUrls: kotlin.Array +, @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "category") - val category: Category? = null, + val category: Category? = null +, @Json(name = "tags") - val tags: kotlin.Array? = null, + val tags: kotlin.Array? = null +, /* pet status in the store */ @Json(name = "status") val status: Pet.Status? = null + ) { /** @@ -46,6 +52,7 @@ data class Pet ( * Values: available,pending,sold */ + enum class Status(val value: kotlin.String){ @Json(name = "available") available("available"), @Json(name = "pending") pending("pending"), diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Tag.kt index f9ef87e13fb..ccdd4390d1a 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -21,8 +21,10 @@ import com.squareup.moshi.Json data class Tag ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "name") val name: kotlin.String? = null + ) diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/User.kt index dfd63806da9..e2679988c51 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/User.kt @@ -27,21 +27,29 @@ import com.squareup.moshi.Json data class User ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "username") - val username: kotlin.String? = null, + val username: kotlin.String? = null +, @Json(name = "firstName") - val firstName: kotlin.String? = null, + val firstName: kotlin.String? = null +, @Json(name = "lastName") - val lastName: kotlin.String? = null, + val lastName: kotlin.String? = null +, @Json(name = "email") - val email: kotlin.String? = null, + val email: kotlin.String? = null +, @Json(name = "password") - val password: kotlin.String? = null, + val password: kotlin.String? = null +, @Json(name = "phone") - val phone: kotlin.String? = null, + val phone: kotlin.String? = null +, /* User Status */ @Json(name = "userStatus") val userStatus: kotlin.Int? = null + ) diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index a03ba02ff08..5d3ecd7b31f 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -85,7 +85,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 " } } } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index eed5027e801..6ce6f25632f 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -23,11 +23,14 @@ import java.io.Serializable data class ApiResponse ( @Json(name = "code") - val code: kotlin.Int? = null, + val code: kotlin.Int? = null +, @Json(name = "type") - val type: kotlin.String? = null, + val type: kotlin.String? = null +, @Json(name = "message") val message: kotlin.String? = null + ) : Serializable { companion object { private const val serialVersionUID: Long = 123 diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Category.kt index f29e6833057..e8c1970031e 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -22,9 +22,11 @@ import java.io.Serializable data class Category ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "name") val name: kotlin.String? = null + ) : Serializable { companion object { private const val serialVersionUID: Long = 123 diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Order.kt index 847b3ff5e28..34ace693158 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -26,18 +26,24 @@ import java.io.Serializable data class Order ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "petId") - val petId: kotlin.Long? = null, + val petId: kotlin.Long? = null +, @Json(name = "quantity") - val quantity: kotlin.Int? = null, + val quantity: kotlin.Int? = null +, @Json(name = "shipDate") - val shipDate: kotlin.String? = null, + val shipDate: kotlin.String? = null +, /* Order Status */ @Json(name = "status") - val status: Order.Status? = null, + val status: Order.Status? = null +, @Json(name = "complete") val complete: kotlin.Boolean? = null + ) : Serializable { companion object { private const val serialVersionUID: Long = 123 @@ -48,6 +54,7 @@ data class Order ( * Values: placed,approved,delivered */ + enum class Status(val value: kotlin.String){ @Json(name = "placed") placed("placed"), @Json(name = "approved") approved("approved"), diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Pet.kt index d3a480e2f14..162e8906c54 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -28,18 +28,24 @@ import java.io.Serializable data class Pet ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "category") - val category: Category? = null, + val category: Category? = null +, @Json(name = "name") - val name: kotlin.String, + val name: kotlin.String +, @Json(name = "photoUrls") - val photoUrls: kotlin.Array, + val photoUrls: kotlin.Array +, @Json(name = "tags") - val tags: kotlin.Array? = null, + val tags: kotlin.Array? = null +, /* pet status in the store */ @Json(name = "status") val status: Pet.Status? = null + ) : Serializable { companion object { private const val serialVersionUID: Long = 123 @@ -50,6 +56,7 @@ data class Pet ( * Values: available,pending,sold */ + enum class Status(val value: kotlin.String){ @Json(name = "available") available("available"), @Json(name = "pending") pending("pending"), diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Tag.kt index aa93e435695..4b36614f2fd 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -22,9 +22,11 @@ import java.io.Serializable data class Tag ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "name") val name: kotlin.String? = null + ) : Serializable { companion object { private const val serialVersionUID: Long = 123 diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/User.kt index 7487ed927d1..e256026ee90 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/User.kt @@ -28,22 +28,30 @@ import java.io.Serializable data class User ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "username") - val username: kotlin.String? = null, + val username: kotlin.String? = null +, @Json(name = "firstName") - val firstName: kotlin.String? = null, + val firstName: kotlin.String? = null +, @Json(name = "lastName") - val lastName: kotlin.String? = null, + val lastName: kotlin.String? = null +, @Json(name = "email") - val email: kotlin.String? = null, + val email: kotlin.String? = null +, @Json(name = "password") - val password: kotlin.String? = null, + val password: kotlin.String? = null +, @Json(name = "phone") - val phone: kotlin.String? = null, + val phone: kotlin.String? = null +, /* User Status */ @Json(name = "userStatus") val userStatus: kotlin.Int? = null + ) : Serializable { companion object { private const val serialVersionUID: Long = 123 diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index a03ba02ff08..5d3ecd7b31f 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -85,7 +85,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 " } } } diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index ada15fee7a1..5078a38f945 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -22,10 +22,13 @@ import com.squareup.moshi.Json data class ApiResponse ( @Json(name = "code") - val code: kotlin.Int? = null, + val code: kotlin.Int? = null +, @Json(name = "type") - val type: kotlin.String? = null, + val type: kotlin.String? = null +, @Json(name = "message") val message: kotlin.String? = null + ) diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Category.kt index 426a0e51592..5473b36a379 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -21,8 +21,10 @@ import com.squareup.moshi.Json data class Category ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "name") val name: kotlin.String? = null + ) diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Order.kt index 8f947e96651..f0464185324 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -25,18 +25,24 @@ import com.squareup.moshi.Json data class Order ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "petId") - val petId: kotlin.Long? = null, + val petId: kotlin.Long? = null +, @Json(name = "quantity") - val quantity: kotlin.Int? = null, + val quantity: kotlin.Int? = null +, @Json(name = "shipDate") - val shipDate: org.threeten.bp.OffsetDateTime? = null, + val shipDate: org.threeten.bp.OffsetDateTime? = null +, /* Order Status */ @Json(name = "status") - val status: Order.Status? = null, + val status: Order.Status? = null +, @Json(name = "complete") val complete: kotlin.Boolean? = null + ) { /** @@ -44,6 +50,7 @@ data class Order ( * Values: placed,approved,delivered */ + enum class Status(val value: kotlin.String){ @Json(name = "placed") placed("placed"), @Json(name = "approved") approved("approved"), diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Pet.kt index a94bb811c3b..9830ead3359 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -27,18 +27,24 @@ import com.squareup.moshi.Json data class Pet ( @Json(name = "name") - val name: kotlin.String, + val name: kotlin.String +, @Json(name = "photoUrls") - val photoUrls: kotlin.Array, + val photoUrls: kotlin.Array +, @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "category") - val category: Category? = null, + val category: Category? = null +, @Json(name = "tags") - val tags: kotlin.Array? = null, + val tags: kotlin.Array? = null +, /* pet status in the store */ @Json(name = "status") val status: Pet.Status? = null + ) { /** @@ -46,6 +52,7 @@ data class Pet ( * Values: available,pending,sold */ + enum class Status(val value: kotlin.String){ @Json(name = "available") available("available"), @Json(name = "pending") pending("pending"), diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Tag.kt index f9ef87e13fb..ccdd4390d1a 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -21,8 +21,10 @@ import com.squareup.moshi.Json data class Tag ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "name") val name: kotlin.String? = null + ) diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/User.kt index dfd63806da9..e2679988c51 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/User.kt @@ -27,21 +27,29 @@ import com.squareup.moshi.Json data class User ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "username") - val username: kotlin.String? = null, + val username: kotlin.String? = null +, @Json(name = "firstName") - val firstName: kotlin.String? = null, + val firstName: kotlin.String? = null +, @Json(name = "lastName") - val lastName: kotlin.String? = null, + val lastName: kotlin.String? = null +, @Json(name = "email") - val email: kotlin.String? = null, + val email: kotlin.String? = null +, @Json(name = "password") - val password: kotlin.String? = null, + val password: kotlin.String? = null +, @Json(name = "phone") - val phone: kotlin.String? = null, + val phone: kotlin.String? = null +, /* User Status */ @Json(name = "userStatus") val userStatus: kotlin.Int? = null + ) diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index a03ba02ff08..5d3ecd7b31f 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -85,7 +85,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 " } } } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index eed5027e801..6ce6f25632f 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -23,11 +23,14 @@ import java.io.Serializable data class ApiResponse ( @Json(name = "code") - val code: kotlin.Int? = null, + val code: kotlin.Int? = null +, @Json(name = "type") - val type: kotlin.String? = null, + val type: kotlin.String? = null +, @Json(name = "message") val message: kotlin.String? = null + ) : Serializable { companion object { private const val serialVersionUID: Long = 123 diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt index f29e6833057..e8c1970031e 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -22,9 +22,11 @@ import java.io.Serializable data class Category ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "name") val name: kotlin.String? = null + ) : Serializable { companion object { private const val serialVersionUID: Long = 123 diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt index 2b92b4375d1..7c1523899ed 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -26,18 +26,24 @@ import java.io.Serializable data class Order ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "petId") - val petId: kotlin.Long? = null, + val petId: kotlin.Long? = null +, @Json(name = "quantity") - val quantity: kotlin.Int? = null, + val quantity: kotlin.Int? = null +, @Json(name = "shipDate") - val shipDate: java.time.OffsetDateTime? = null, + val shipDate: java.time.OffsetDateTime? = null +, /* Order Status */ @Json(name = "status") - val status: Order.Status? = null, + val status: Order.Status? = null +, @Json(name = "complete") val complete: kotlin.Boolean? = null + ) : Serializable { companion object { private const val serialVersionUID: Long = 123 @@ -48,6 +54,7 @@ data class Order ( * Values: placed,approved,delivered */ + enum class Status(val value: kotlin.String){ @Json(name = "placed") placed("placed"), @Json(name = "approved") approved("approved"), diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt index bb0a5df6e19..09ce86f9be4 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -28,18 +28,24 @@ import java.io.Serializable data class Pet ( @Json(name = "name") - val name: kotlin.String, + val name: kotlin.String +, @Json(name = "photoUrls") - val photoUrls: kotlin.Array, + val photoUrls: kotlin.Array +, @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "category") - val category: Category? = null, + val category: Category? = null +, @Json(name = "tags") - val tags: kotlin.Array? = null, + val tags: kotlin.Array? = null +, /* pet status in the store */ @Json(name = "status") val status: Pet.Status? = null + ) : Serializable { companion object { private const val serialVersionUID: Long = 123 @@ -50,6 +56,7 @@ data class Pet ( * Values: available,pending,sold */ + enum class Status(val value: kotlin.String){ @Json(name = "available") available("available"), @Json(name = "pending") pending("pending"), diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt index aa93e435695..4b36614f2fd 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -22,9 +22,11 @@ import java.io.Serializable data class Tag ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "name") val name: kotlin.String? = null + ) : Serializable { companion object { private const val serialVersionUID: Long = 123 diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt index 7487ed927d1..e256026ee90 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt @@ -28,22 +28,30 @@ import java.io.Serializable data class User ( @Json(name = "id") - val id: kotlin.Long? = null, + val id: kotlin.Long? = null +, @Json(name = "username") - val username: kotlin.String? = null, + val username: kotlin.String? = null +, @Json(name = "firstName") - val firstName: kotlin.String? = null, + val firstName: kotlin.String? = null +, @Json(name = "lastName") - val lastName: kotlin.String? = null, + val lastName: kotlin.String? = null +, @Json(name = "email") - val email: kotlin.String? = null, + val email: kotlin.String? = null +, @Json(name = "password") - val password: kotlin.String? = null, + val password: kotlin.String? = null +, @Json(name = "phone") - val phone: kotlin.String? = null, + val phone: kotlin.String? = null +, /* User Status */ @Json(name = "userStatus") val userStatus: kotlin.Int? = null + ) : Serializable { companion object { private const val serialVersionUID: Long = 123