diff --git a/docs/generators/kotlin-server.md b/docs/generators/kotlin-server.md index 58852a97ccf4..ecaf99a294f2 100644 --- a/docs/generators/kotlin-server.md +++ b/docs/generators/kotlin-server.md @@ -32,8 +32,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Type/Alias | Imports | | ---------- | ------- | |BigDecimal|java.math.BigDecimal| -|Date|java.util.Date| -|DateTime|java.time.LocalDateTime| +|Date|java.time.LocalDate| +|DateTime|java.time.OffsetDateTime| |File|java.io.File| |LocalDate|java.time.LocalDate| |LocalDateTime|java.time.LocalDateTime| diff --git a/docs/generators/kotlin-vertx.md b/docs/generators/kotlin-vertx.md index 56539f00d46e..f92dadaf520a 100644 --- a/docs/generators/kotlin-vertx.md +++ b/docs/generators/kotlin-vertx.md @@ -26,8 +26,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Type/Alias | Imports | | ---------- | ------- | |BigDecimal|java.math.BigDecimal| -|Date|java.util.Date| -|DateTime|java.time.LocalDateTime| +|Date|java.time.LocalDate| +|DateTime|java.time.OffsetDateTime| |File|java.io.File| |LocalDate|java.time.LocalDate| |LocalDateTime|java.time.LocalDateTime| diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index cdf4968400b2..ef76c9af691b 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -34,8 +34,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Type/Alias | Imports | | ---------- | ------- | |BigDecimal|java.math.BigDecimal| -|Date|java.util.Date| -|DateTime|java.time.LocalDateTime| +|Date|java.time.LocalDate| +|DateTime|java.time.OffsetDateTime| |File|java.io.File| |LocalDate|java.time.LocalDate| |LocalDateTime|java.time.LocalDateTime| diff --git a/docs/generators/ktorm-schema.md b/docs/generators/ktorm-schema.md index 4f65a1ecc81f..7a45b88b69a3 100644 --- a/docs/generators/ktorm-schema.md +++ b/docs/generators/ktorm-schema.md @@ -27,8 +27,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Type/Alias | Imports | | ---------- | ------- | |BigDecimal|java.math.BigDecimal| -|Date|java.util.Date| -|DateTime|java.time.LocalDateTime| +|Date|java.time.LocalDate| +|DateTime|java.time.OffsetDateTime| |File|java.io.File| |LocalDate|java.time.LocalDate| |LocalDateTime|java.time.LocalDateTime| 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 32c7c3cff45a..79152024e3e3 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 @@ -153,7 +153,7 @@ public AbstractKotlinCodegen() { typeMapping.put("ByteArray", "kotlin.ByteArray"); typeMapping.put("number", "java.math.BigDecimal"); typeMapping.put("decimal", "java.math.BigDecimal"); - typeMapping.put("date-time", "java.time.LocalDateTime"); + typeMapping.put("date-time", "java.time.OffsetDateTime"); typeMapping.put("date", "java.time.LocalDate"); typeMapping.put("file", "java.io.File"); typeMapping.put("array", "kotlin.Array"); @@ -163,7 +163,7 @@ public AbstractKotlinCodegen() { typeMapping.put("object", "kotlin.Any"); typeMapping.put("binary", "kotlin.ByteArray"); typeMapping.put("Date", "java.time.LocalDate"); - typeMapping.put("DateTime", "java.time.LocalDateTime"); + typeMapping.put("DateTime", "java.time.OffsetDateTime"); instantiationTypes.put("array", "kotlin.collections.ArrayList"); instantiationTypes.put("list", "kotlin.collections.ArrayList"); @@ -174,9 +174,9 @@ public AbstractKotlinCodegen() { importMapping.put("UUID", "java.util.UUID"); importMapping.put("URI", "java.net.URI"); importMapping.put("File", "java.io.File"); - importMapping.put("Date", "java.util.Date"); + importMapping.put("Date", "java.time.LocalDate"); importMapping.put("Timestamp", "java.sql.Timestamp"); - importMapping.put("DateTime", "java.time.LocalDateTime"); + importMapping.put("DateTime", "java.time.OffsetDateTime"); importMapping.put("LocalDateTime", "java.time.LocalDateTime"); importMapping.put("LocalDate", "java.time.LocalDate"); importMapping.put("LocalTime", "java.time.LocalTime"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java index 909c1f59cf20..29f2bc72c8a3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java @@ -125,17 +125,9 @@ public KotlinSpringServerCodegen() { typeMapping.put("array", "kotlin.collections.List"); typeMapping.put("list", "kotlin.collections.List"); - typeMapping.put("date", "java.time.LocalDate"); - typeMapping.put("date-time", "java.time.OffsetDateTime"); - typeMapping.put("Date", "java.time.LocalDate"); - typeMapping.put("DateTime", "java.time.OffsetDateTime"); - // use resource for file handling typeMapping.put("file", "org.springframework.core.io.Resource"); - importMapping.put("Date", "java.time.LocalDate"); - importMapping.put("DateTime", "java.time.OffsetDateTime"); - addOption(TITLE, "server title name or client service name", title); addOption(BASE_PACKAGE, "base package (invokerPackage) for generated code", basePackage); addOption(SERVER_PORT, "configuration the port in which the sever is to run on", serverPort); 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 7ccd50796773..3074614db75b 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache @@ -2,7 +2,6 @@ package {{packageName}}.infrastructure {{#moshi}} import com.squareup.moshi.Moshi -import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter {{^moshiCodeGen}} import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory {{/moshiCodeGen}} @@ -36,7 +35,6 @@ import java.util.Date {{#moshi}} @JvmStatic val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) .add(OffsetDateTimeAdapter()) .add(LocalDateTimeAdapter()) .add(LocalDateAdapter()) @@ -54,7 +52,6 @@ import java.util.Date {{#gson}} @JvmStatic val gsonBuilder: GsonBuilder = GsonBuilder() - .registerTypeAdapter(Date::class.java, DateAdapter()) .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index 6465f1485531..b80e0390de2d 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -11,7 +11,6 @@ import java.util.Date object Serializer { @JvmStatic val gsonBuilder: GsonBuilder = GsonBuilder() - .registerTypeAdapter(Date::class.java, DateAdapter()) .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index 697559b2ec16..9a45b67d9b1a 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -1,14 +1,12 @@ package org.openapitools.client.infrastructure import com.squareup.moshi.Moshi -import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory import java.util.Date object Serializer { @JvmStatic val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) .add(OffsetDateTimeAdapter()) .add(LocalDateTimeAdapter()) .add(LocalDateAdapter()) diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index 6465f1485531..b80e0390de2d 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -11,7 +11,6 @@ import java.util.Date object Serializer { @JvmStatic val gsonBuilder: GsonBuilder = GsonBuilder() - .registerTypeAdapter(Date::class.java, DateAdapter()) .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index 06d9fe0bdc8a..25447c818e66 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -1,13 +1,11 @@ package org.openapitools.client.infrastructure import com.squareup.moshi.Moshi -import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter import java.util.Date object Serializer { @JvmStatic val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) .add(OffsetDateTimeAdapter()) .add(LocalDateTimeAdapter()) .add(LocalDateAdapter()) diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index 371e2a7013e5..7265f7591428 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -1,14 +1,12 @@ package org.openapitools.client.infrastructure import com.squareup.moshi.Moshi -import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory import java.util.Date internal object Serializer { @JvmStatic val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) .add(OffsetDateTimeAdapter()) .add(LocalDateTimeAdapter()) .add(LocalDateAdapter()) diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index 697559b2ec16..9a45b67d9b1a 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -1,14 +1,12 @@ package org.openapitools.client.infrastructure import com.squareup.moshi.Moshi -import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory import java.util.Date object Serializer { @JvmStatic val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) .add(OffsetDateTimeAdapter()) .add(LocalDateTimeAdapter()) .add(LocalDateAdapter()) diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index 697559b2ec16..9a45b67d9b1a 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -1,14 +1,12 @@ package org.openapitools.client.infrastructure import com.squareup.moshi.Moshi -import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory import java.util.Date object Serializer { @JvmStatic val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) .add(OffsetDateTimeAdapter()) .add(LocalDateTimeAdapter()) .add(LocalDateAdapter()) diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index 697559b2ec16..9a45b67d9b1a 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -1,14 +1,12 @@ package org.openapitools.client.infrastructure import com.squareup.moshi.Moshi -import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory import java.util.Date object Serializer { @JvmStatic val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) .add(OffsetDateTimeAdapter()) .add(LocalDateTimeAdapter()) .add(LocalDateAdapter()) diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index 697559b2ec16..9a45b67d9b1a 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -1,14 +1,12 @@ package org.openapitools.client.infrastructure import com.squareup.moshi.Moshi -import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory import java.util.Date object Serializer { @JvmStatic val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) .add(OffsetDateTimeAdapter()) .add(LocalDateTimeAdapter()) .add(LocalDateAdapter()) diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index 697559b2ec16..9a45b67d9b1a 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -1,14 +1,12 @@ package org.openapitools.client.infrastructure import com.squareup.moshi.Moshi -import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory import java.util.Date object Serializer { @JvmStatic val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) .add(OffsetDateTimeAdapter()) .add(LocalDateTimeAdapter()) .add(LocalDateAdapter()) diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index 697559b2ec16..9a45b67d9b1a 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -1,14 +1,12 @@ package org.openapitools.client.infrastructure import com.squareup.moshi.Moshi -import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory import java.util.Date object Serializer { @JvmStatic val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) .add(OffsetDateTimeAdapter()) .add(LocalDateTimeAdapter()) .add(LocalDateAdapter()) diff --git a/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION b/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION index d99e7162d01f..3fa3b389a57d 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.0-SNAPSHOT \ No newline at end of file +5.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/build.gradle b/samples/client/petstore/kotlin-uppercase-enum/build.gradle index adff312f725c..56be0bd0dd87 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/build.gradle +++ b/samples/client/petstore/kotlin-uppercase-enum/build.gradle @@ -33,6 +33,5 @@ dependencies { compile "com.squareup.moshi:moshi-kotlin:1.9.2" compile "com.squareup.moshi:moshi-adapters:1.9.2" compile "com.squareup.okhttp3:okhttp:4.2.2" - compile "com.squareup.okhttp3:logging-interceptor:4.4.0" testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0" } diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt index 69b562becb07..9bd2790dc144 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt @@ -10,6 +10,7 @@ val Response.isInformational : Boolean get() = this.code in 100..199 /** * Provides an extension to evaluation whether the response is a 3xx code */ +@Suppress("EXTENSION_SHADOWED_BY_MEMBER") val Response.isRedirect : Boolean get() = this.code in 300..399 /** diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index 697559b2ec16..9a45b67d9b1a 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -1,14 +1,12 @@ package org.openapitools.client.infrastructure import com.squareup.moshi.Moshi -import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory import java.util.Date object Serializer { @JvmStatic val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) .add(OffsetDateTimeAdapter()) .add(LocalDateTimeAdapter()) .add(LocalDateAdapter()) diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index 697559b2ec16..9a45b67d9b1a 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -1,14 +1,12 @@ package org.openapitools.client.infrastructure import com.squareup.moshi.Moshi -import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory import java.util.Date object Serializer { @JvmStatic val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) .add(OffsetDateTimeAdapter()) .add(LocalDateTimeAdapter()) .add(LocalDateAdapter()) diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/.openapi-generator/FILES b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/.openapi-generator/FILES index 106ea4db2ae5..2fcf69d6457e 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/.openapi-generator/FILES @@ -27,12 +27,6 @@ docs/Foo.md docs/FormatTest.md docs/HasOnlyReadOnly.md docs/HealthCheckResult.md -docs/InlineObject.md -docs/InlineObject1.md -docs/InlineObject2.md -docs/InlineObject3.md -docs/InlineObject4.md -docs/InlineObject5.md docs/InlineResponseDefault.md docs/List.md docs/MapTest.md @@ -100,12 +94,6 @@ src/main/kotlin/org/openapitools/client/models/Foo.kt src/main/kotlin/org/openapitools/client/models/FormatTest.kt src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt -src/main/kotlin/org/openapitools/client/models/InlineObject.kt -src/main/kotlin/org/openapitools/client/models/InlineObject1.kt -src/main/kotlin/org/openapitools/client/models/InlineObject2.kt -src/main/kotlin/org/openapitools/client/models/InlineObject3.kt -src/main/kotlin/org/openapitools/client/models/InlineObject4.kt -src/main/kotlin/org/openapitools/client/models/InlineObject5.kt src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt src/main/kotlin/org/openapitools/client/models/List.kt src/main/kotlin/org/openapitools/client/models/MapTest.kt diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/.openapi-generator/VERSION b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/.openapi-generator/VERSION index d99e7162d01f..3fa3b389a57d 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.0-SNAPSHOT \ No newline at end of file +5.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/README.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/README.md index 7d37a6283317..fca869bcf493 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/README.md +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/README.md @@ -101,12 +101,6 @@ Class | Method | HTTP request | Description - [org.openapitools.client.models.FormatTest](docs/FormatTest.md) - [org.openapitools.client.models.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - [org.openapitools.client.models.HealthCheckResult](docs/HealthCheckResult.md) - - [org.openapitools.client.models.InlineObject](docs/InlineObject.md) - - [org.openapitools.client.models.InlineObject1](docs/InlineObject1.md) - - [org.openapitools.client.models.InlineObject2](docs/InlineObject2.md) - - [org.openapitools.client.models.InlineObject3](docs/InlineObject3.md) - - [org.openapitools.client.models.InlineObject4](docs/InlineObject4.md) - - [org.openapitools.client.models.InlineObject5](docs/InlineObject5.md) - [org.openapitools.client.models.InlineResponseDefault](docs/InlineResponseDefault.md) - [org.openapitools.client.models.List](docs/List.md) - [org.openapitools.client.models.MapTest](docs/MapTest.md) diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/build.gradle b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/build.gradle index 9c970542197e..7bce53584b2c 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/build.gradle +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/build.gradle @@ -30,8 +30,9 @@ test { dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.0" compile "com.google.code.gson:gson:2.8.6" + compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.0" + compile "com.squareup.okhttp3:logging-interceptor:4.4.0" compile "com.squareup.retrofit2:retrofit:$retrofitVersion" compile "com.squareup.retrofit2:converter-gson:$retrofitVersion" compile "com.squareup.retrofit2:converter-scalars:$retrofitVersion" diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FakeApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FakeApi.md index 6220efdaa290..1ea11abbf1fc 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FakeApi.md @@ -460,13 +460,13 @@ To test enum parameters val apiClient = ApiClient() val webService = apiClient.createWebservice(FakeApi::class.java) -val enumHeaderStringArray : kotlin.Array = // kotlin.Array | Header parameter enum test (string array) +val enumHeaderStringArray : kotlin.collections.List = // kotlin.collections.List | Header parameter enum test (string array) val enumHeaderString : kotlin.String = enumHeaderString_example // kotlin.String | Header parameter enum test (string) -val enumQueryStringArray : kotlin.Array = // kotlin.Array | Query parameter enum test (string array) +val enumQueryStringArray : kotlin.collections.List = // kotlin.collections.List | Query parameter enum test (string array) val enumQueryString : kotlin.String = enumQueryString_example // kotlin.String | Query parameter enum test (string) val enumQueryInteger : kotlin.Int = 56 // kotlin.Int | Query parameter enum test (double) val enumQueryDouble : kotlin.Double = 1.2 // kotlin.Double | Query parameter enum test (double) -val enumFormStringArray : kotlin.Array = enumFormStringArray_example // kotlin.Array | Form parameter enum test (string array) +val enumFormStringArray : kotlin.collections.List = enumFormStringArray_example // kotlin.collections.List | Form parameter enum test (string array) val enumFormString : kotlin.String = enumFormString_example // kotlin.String | Form parameter enum test (string) launch(Dispatchers.IO) { @@ -478,14 +478,14 @@ launch(Dispatchers.IO) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] - **enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to "-efg"] [enum: _abc, -efg, (xyz)] - **enumQueryStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] - **enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to "-efg"] [enum: _abc, -efg, (xyz)] + **enumHeaderStringArray** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] + **enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + **enumQueryStringArray** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] + **enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumQueryInteger** | **kotlin.Int**| Query parameter enum test (double) | [optional] [enum: 1, -2] **enumQueryDouble** | **kotlin.Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] - **enumFormStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to "$"] [enum: >, $] - **enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to "-efg"] [enum: _abc, -efg, (xyz)] + **enumFormStringArray** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to $] [enum: >, $] + **enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] ### Return type @@ -645,11 +645,11 @@ To test the collection format in query parameters val apiClient = ApiClient() val webService = apiClient.createWebservice(FakeApi::class.java) -val pipe : kotlin.Array = // kotlin.Array | -val ioutil : kotlin.Array = // kotlin.Array | -val http : kotlin.Array = // kotlin.Array | -val url : kotlin.Array = // kotlin.Array | -val context : kotlin.Array = // kotlin.Array | +val pipe : kotlin.collections.List = // kotlin.collections.List | +val ioutil : kotlin.collections.List = // kotlin.collections.List | +val http : kotlin.collections.List = // kotlin.collections.List | +val url : kotlin.collections.List = // kotlin.collections.List | +val context : kotlin.collections.List = // kotlin.collections.List | launch(Dispatchers.IO) { webService.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) @@ -660,11 +660,11 @@ launch(Dispatchers.IO) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pipe** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | - **ioutil** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | - **http** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | - **url** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | - **context** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **pipe** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | + **ioutil** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | + **http** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | + **url** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | + **context** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | ### Return type diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FormatTest.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FormatTest.md index 0357923c97a5..01b408499e73 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FormatTest.md +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FormatTest.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **int64** | **kotlin.Long** | | [optional] **float** | **kotlin.Float** | | [optional] **double** | **kotlin.Double** | | [optional] +**decimal** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] **string** | **kotlin.String** | | [optional] **binary** | [**java.io.File**](java.io.File.md) | | [optional] **dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/List.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/List.md index 13a09a4c4141..f426d541a409 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/List.md +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/List.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**`123minusList`** | **kotlin.String** | | [optional] +**`123list`** | **kotlin.String** | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/PetApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/PetApi.md index 44d832909311..9b0310b42aad 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/PetApi.md +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/PetApi.md @@ -107,10 +107,10 @@ Multiple status values can be provided with comma separated strings val apiClient = ApiClient() val webService = apiClient.createWebservice(PetApi::class.java) -val status : kotlin.Array = // kotlin.Array | Status values that need to be considered for filter +val status : kotlin.collections.List = // kotlin.collections.List | Status values that need to be considered for filter launch(Dispatchers.IO) { - val result : kotlin.Array = webService.findPetsByStatus(status) + val result : kotlin.collections.List = webService.findPetsByStatus(status) } ``` @@ -118,11 +118,11 @@ launch(Dispatchers.IO) { 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] + **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] ### Return type -[**kotlin.Array<Pet>**](Pet.md) +[**kotlin.collections.List<Pet>**](Pet.md) ### Authorization @@ -147,10 +147,10 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 val apiClient = ApiClient() val webService = apiClient.createWebservice(PetApi::class.java) -val tags : kotlin.Array = // kotlin.Array | Tags to filter by +val tags : kotlin.collections.List = // kotlin.collections.List | Tags to filter by launch(Dispatchers.IO) { - val result : kotlin.Array = webService.findPetsByTags(tags) + val result : kotlin.collections.List = webService.findPetsByTags(tags) } ``` @@ -158,11 +158,11 @@ launch(Dispatchers.IO) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Tags to filter by | + **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | ### Return type -[**kotlin.Array<Pet>**](Pet.md) +[**kotlin.collections.List<Pet>**](Pet.md) ### Authorization diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/SpecialModelName.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/SpecialModelName.md index 282649449d96..b179e705ab05 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/SpecialModelName.md +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/SpecialModelName.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **kotlin.Long** | | [optional] +**dollarSpecialPropertyName** | **kotlin.Long** | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/UserApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/UserApi.md index 5cf484387734..c7b08232ddf5 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/UserApi.md +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/UserApi.md @@ -66,7 +66,7 @@ Creates list of users with given input array val apiClient = ApiClient() val webService = apiClient.createWebservice(UserApi::class.java) -val user : kotlin.Array = // kotlin.Array | List of user object +val user : kotlin.collections.List = // kotlin.collections.List | List of user object launch(Dispatchers.IO) { webService.createUsersWithArrayInput(user) @@ -77,7 +77,7 @@ launch(Dispatchers.IO) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.Array<User>**](User.md)| List of user object | + **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | ### Return type @@ -104,7 +104,7 @@ Creates list of users with given input array val apiClient = ApiClient() val webService = apiClient.createWebservice(UserApi::class.java) -val user : kotlin.Array = // kotlin.Array | List of user object +val user : kotlin.collections.List = // kotlin.collections.List | List of user object launch(Dispatchers.IO) { webService.createUsersWithListInput(user) @@ -115,7 +115,7 @@ launch(Dispatchers.IO) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.Array<User>**](User.md)| List of user object | + **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | ### Return type diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt index 8dc4e6d334e9..18be349e9d6d 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt @@ -15,7 +15,7 @@ interface AnotherFakeApi { * - 200: successful operation * * @param client client model - * @return [Client] + * @return [Client] */ @PATCH("another-fake/dummy") suspend fun call123testSpecialTags(@Body client: Client): Response diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index 27bde56495c0..0d4492f9cced 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -14,7 +14,7 @@ interface DefaultApi { * Responses: * - 0: response * - * @return [InlineResponseDefault] + * @return [InlineResponseDefault] */ @GET("foo") suspend fun fooGet(): Response diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt index 8e8d0a6bf63e..05c879abb352 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt @@ -12,6 +12,8 @@ import org.openapitools.client.models.OuterComposite import org.openapitools.client.models.Pet import org.openapitools.client.models.User +import okhttp3.MultipartBody + interface FakeApi { /** * Health check endpoint @@ -19,7 +21,7 @@ interface FakeApi { * Responses: * - 200: The instance started successfully * - * @return [HealthCheckResult] + * @return [HealthCheckResult] */ @GET("fake/health") suspend fun fakeHealthGet(): Response @@ -33,10 +35,10 @@ interface FakeApi { * @param pet Pet object that needs to be added to the store * @param query1 query parameter (optional) * @param header1 header parameter (optional) - * @return [Unit] + * @return [Unit] */ @GET("fake/http-signature-test") - suspend fun fakeHttpSignatureTest(@Body pet: Pet, @Query("query_1") query1: kotlin.String, @Header("header_1") header1: kotlin.String): Response + suspend fun fakeHttpSignatureTest(@Body pet: Pet, @Query("query_1") query1: kotlin.String? = null, @Header("header_1") header1: kotlin.String): Response /** * @@ -45,7 +47,7 @@ interface FakeApi { * - 200: Output boolean * * @param body Input boolean as post body (optional) - * @return [kotlin.Boolean] + * @return [kotlin.Boolean] */ @POST("fake/outer/boolean") suspend fun fakeOuterBooleanSerialize(@Body body: kotlin.Boolean? = null): Response @@ -57,7 +59,7 @@ interface FakeApi { * - 200: Output composite * * @param outerComposite Input composite as post body (optional) - * @return [OuterComposite] + * @return [OuterComposite] */ @POST("fake/outer/composite") suspend fun fakeOuterCompositeSerialize(@Body outerComposite: OuterComposite? = null): Response @@ -69,7 +71,7 @@ interface FakeApi { * - 200: Output number * * @param body Input number as post body (optional) - * @return [java.math.BigDecimal] + * @return [java.math.BigDecimal] */ @POST("fake/outer/number") suspend fun fakeOuterNumberSerialize(@Body body: java.math.BigDecimal? = null): Response @@ -81,7 +83,7 @@ interface FakeApi { * - 200: Output string * * @param body Input string as post body (optional) - * @return [kotlin.String] + * @return [kotlin.String] */ @POST("fake/outer/string") suspend fun fakeOuterStringSerialize(@Body body: kotlin.String? = null): Response @@ -93,7 +95,7 @@ interface FakeApi { * - 200: Success * * @param fileSchemaTestClass - * @return [Unit] + * @return [Unit] */ @PUT("fake/body-with-file-schema") suspend fun testBodyWithFileSchema(@Body fileSchemaTestClass: FileSchemaTestClass): Response @@ -106,7 +108,7 @@ interface FakeApi { * * @param query * @param user - * @return [Unit] + * @return [Unit] */ @PUT("fake/body-with-query-params") suspend fun testBodyWithQueryParams(@Query("query") query: kotlin.String, @Body user: User): Response @@ -118,7 +120,7 @@ interface FakeApi { * - 200: successful operation * * @param client client model - * @return [Client] + * @return [Client] */ @PATCH("fake") suspend fun testClientModel(@Body client: Client): Response @@ -144,7 +146,7 @@ interface FakeApi { * @param dateTime None (optional) * @param password None (optional) * @param paramCallback None (optional) - * @return [Unit] + * @return [Unit] */ @FormUrlEncoded @POST("fake") @@ -158,18 +160,18 @@ interface FakeApi { * - 404: Not found * * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to "-efg") + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to "-efg") + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) * @param enumQueryInteger Query parameter enum test (double) (optional) * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to "$") - * @param enumFormString Form parameter enum test (string) (optional, default to "-efg") - * @return [Unit] + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return [Unit] */ @FormUrlEncoded @GET("fake") - suspend fun testEnumParameters(@Header("enum_header_string_array") enumHeaderStringArray: kotlin.Array, @Header("enum_header_string") enumHeaderString: kotlin.String, @Query("enum_query_string_array") enumQueryStringArray: kotlin.Array, @Query("enum_query_string") enumQueryString: kotlin.String, @Query("enum_query_integer") enumQueryInteger: kotlin.Int, @Query("enum_query_double") enumQueryDouble: kotlin.Double, @Field("enum_form_string_array") enumFormStringArray: kotlin.Array, @Field("enum_form_string") enumFormString: kotlin.String): Response + suspend fun testEnumParameters(@Header("enum_header_string_array") enumHeaderStringArray: kotlin.collections.List, @Header("enum_header_string") enumHeaderString: kotlin.String, @Query("enum_query_string_array") enumQueryStringArray: kotlin.collections.List? = null, @Query("enum_query_string") enumQueryString: kotlin.String? = null, @Query("enum_query_integer") enumQueryInteger: kotlin.Int? = null, @Query("enum_query_double") enumQueryDouble: kotlin.Double? = null, @Field("enum_form_string_array") enumFormStringArray: kotlin.collections.List, @Field("enum_form_string") enumFormString: kotlin.String): Response /** * Fake endpoint to test group parameters (optional) @@ -183,10 +185,10 @@ interface FakeApi { * @param stringGroup String in group parameters (optional) * @param booleanGroup Boolean in group parameters (optional) * @param int64Group Integer in group parameters (optional) - * @return [Unit] + * @return [Unit] */ @DELETE("fake") - suspend fun testGroupParameters(@Query("required_string_group") requiredStringGroup: kotlin.Int, @Header("required_boolean_group") requiredBooleanGroup: kotlin.Boolean, @Query("required_int64_group") requiredInt64Group: kotlin.Long, @Query("string_group") stringGroup: kotlin.Int, @Header("boolean_group") booleanGroup: kotlin.Boolean, @Query("int64_group") int64Group: kotlin.Long): Response + suspend fun testGroupParameters(@Query("required_string_group") requiredStringGroup: kotlin.Int, @Header("required_boolean_group") requiredBooleanGroup: kotlin.Boolean, @Query("required_int64_group") requiredInt64Group: kotlin.Long, @Query("string_group") stringGroup: kotlin.Int? = null, @Header("boolean_group") booleanGroup: kotlin.Boolean, @Query("int64_group") int64Group: kotlin.Long? = null): Response /** * test inline additionalProperties @@ -195,7 +197,7 @@ interface FakeApi { * - 200: successful operation * * @param requestBody request body - * @return [Unit] + * @return [Unit] */ @POST("fake/inline-additionalProperties") suspend fun testInlineAdditionalProperties(@Body requestBody: kotlin.collections.Map): Response @@ -208,7 +210,7 @@ interface FakeApi { * * @param param field1 * @param param2 field2 - * @return [Unit] + * @return [Unit] */ @FormUrlEncoded @GET("fake/jsonFormData") @@ -225,9 +227,9 @@ interface FakeApi { * @param http * @param url * @param context - * @return [Unit] + * @return [Unit] */ @PUT("fake/test-query-paramters") - suspend fun testQueryParameterCollectionFormat(@Query("pipe") pipe: kotlin.Array, @Query("ioutil") ioutil: CSVParams, @Query("http") http: SSVParams, @Query("url") url: CSVParams, @Query("context") context: kotlin.Array): Response + suspend fun testQueryParameterCollectionFormat(@Query("pipe") pipe: kotlin.collections.List, @Query("ioutil") ioutil: CSVParams, @Query("http") http: SSVParams, @Query("url") url: CSVParams, @Query("context") context: kotlin.collections.List): Response } diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt index 773483df2a67..c4733d0835ba 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt @@ -15,7 +15,7 @@ interface FakeClassnameTags123Api { * - 200: successful operation * * @param client client model - * @return [Client] + * @return [Client] */ @PATCH("fake_classname_test") suspend fun testClassname(@Body client: Client): Response diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index c4a95abd2f3f..c149a3ffce34 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -8,15 +8,18 @@ import okhttp3.RequestBody import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet +import okhttp3.MultipartBody + interface PetApi { /** * Add a new pet to the store * * Responses: + * - 200: Successful operation * - 405: Invalid input * * @param pet Pet object that needs to be added to the store - * @return [Unit] + * @return [Unit] */ @POST("pet") suspend fun addPet(@Body pet: Pet): Response @@ -25,11 +28,12 @@ interface PetApi { * Deletes a pet * * Responses: + * - 200: Successful operation * - 400: Invalid pet value * * @param petId Pet id to delete * @param apiKey (optional) - * @return [Unit] + * @return [Unit] */ @DELETE("pet/{petId}") suspend fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String): Response @@ -42,10 +46,10 @@ interface PetApi { * - 400: Invalid status value * * @param status Status values that need to be considered for filter - * @return [kotlin.Array] + * @return [kotlin.collections.List] */ @GET("pet/findByStatus") - suspend fun findPetsByStatus(@Query("status") status: CSVParams): Response> + suspend fun findPetsByStatus(@Query("status") status: CSVParams): Response> /** * Finds Pets by tags @@ -55,11 +59,11 @@ interface PetApi { * - 400: Invalid tag value * * @param tags Tags to filter by - * @return [kotlin.Array] + * @return [kotlin.collections.List] */ @Deprecated("This api was deprecated") @GET("pet/findByTags") - suspend fun findPetsByTags(@Query("tags") tags: CSVParams): Response> + suspend fun findPetsByTags(@Query("tags") tags: CSVParams): Response> /** * Find pet by ID @@ -70,7 +74,7 @@ interface PetApi { * - 404: Pet not found * * @param petId ID of pet to return - * @return [Pet] + * @return [Pet] */ @GET("pet/{petId}") suspend fun getPetById(@Path("petId") petId: kotlin.Long): Response @@ -79,12 +83,13 @@ interface PetApi { * Update an existing pet * * Responses: + * - 200: Successful operation * - 400: Invalid ID supplied * - 404: Pet not found * - 405: Validation exception * * @param pet Pet object that needs to be added to the store - * @return [Unit] + * @return [Unit] */ @PUT("pet") suspend fun updatePet(@Body pet: Pet): Response @@ -93,12 +98,13 @@ interface PetApi { * Updates a pet in the store with form data * * Responses: + * - 200: Successful operation * - 405: Invalid input * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) - * @return [Unit] + * @return [Unit] */ @FormUrlEncoded @POST("pet/{petId}") @@ -113,7 +119,7 @@ interface PetApi { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return [ApiResponse] + * @return [ApiResponse] */ @Multipart @POST("pet/{petId}/uploadImage") @@ -128,7 +134,7 @@ interface PetApi { * @param petId ID of pet to update * @param requiredFile file to upload * @param additionalMetadata Additional data to pass to server (optional) - * @return [ApiResponse] + * @return [ApiResponse] */ @Multipart @POST("fake/{petId}/uploadImageWithRequiredFile") diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 7171b3d45c58..13b1b964164c 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -16,7 +16,7 @@ interface StoreApi { * - 404: Order not found * * @param orderId ID of the order that needs to be deleted - * @return [Unit] + * @return [Unit] */ @DELETE("store/order/{order_id}") suspend fun deleteOrder(@Path("order_id") orderId: kotlin.String): Response @@ -27,7 +27,7 @@ interface StoreApi { * Responses: * - 200: successful operation * - * @return [kotlin.collections.Map] + * @return [kotlin.collections.Map] */ @GET("store/inventory") suspend fun getInventory(): Response> @@ -41,7 +41,7 @@ interface StoreApi { * - 404: Order not found * * @param orderId ID of pet that needs to be fetched - * @return [Order] + * @return [Order] */ @GET("store/order/{order_id}") suspend fun getOrderById(@Path("order_id") orderId: kotlin.Long): Response @@ -54,7 +54,7 @@ interface StoreApi { * - 400: Invalid Order * * @param order order placed for purchasing the pet - * @return [Order] + * @return [Order] */ @POST("store/order") suspend fun placeOrder(@Body order: Order): Response diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 2d0bd056b8ef..5faf314cdde8 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -15,7 +15,7 @@ interface UserApi { * - 0: successful operation * * @param user Created user object - * @return [Unit] + * @return [Unit] */ @POST("user") suspend fun createUser(@Body user: User): Response @@ -27,10 +27,10 @@ interface UserApi { * - 0: successful operation * * @param user List of user object - * @return [Unit] + * @return [Unit] */ @POST("user/createWithArray") - suspend fun createUsersWithArrayInput(@Body user: kotlin.Array): Response + suspend fun createUsersWithArrayInput(@Body user: kotlin.collections.List): Response /** * Creates list of users with given input array @@ -39,10 +39,10 @@ interface UserApi { * - 0: successful operation * * @param user List of user object - * @return [Unit] + * @return [Unit] */ @POST("user/createWithList") - suspend fun createUsersWithListInput(@Body user: kotlin.Array): Response + suspend fun createUsersWithListInput(@Body user: kotlin.collections.List): Response /** * Delete user @@ -52,7 +52,7 @@ interface UserApi { * - 404: User not found * * @param username The name that needs to be deleted - * @return [Unit] + * @return [Unit] */ @DELETE("user/{username}") suspend fun deleteUser(@Path("username") username: kotlin.String): Response @@ -66,7 +66,7 @@ interface UserApi { * - 404: User not found * * @param username The name that needs to be fetched. Use user1 for testing. - * @return [User] + * @return [User] */ @GET("user/{username}") suspend fun getUserByName(@Path("username") username: kotlin.String): Response @@ -80,7 +80,7 @@ interface UserApi { * * @param username The user name for login * @param password The password for login in clear text - * @return [kotlin.String] + * @return [kotlin.String] */ @GET("user/login") suspend fun loginUser(@Query("username") username: kotlin.String, @Query("password") password: kotlin.String): Response @@ -91,7 +91,7 @@ interface UserApi { * Responses: * - 0: successful operation * - * @return [Unit] + * @return [Unit] */ @GET("user/logout") suspend fun logoutUser(): Response @@ -105,7 +105,7 @@ interface UserApi { * * @param username name that need to be deleted * @param user Updated user object - * @return [Unit] + * @return [Unit] */ @PUT("user/{username}") suspend fun updateUser(@Path("username") username: kotlin.String, @Body user: User): Response diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index d40b63497826..faf5bd523fe0 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -21,7 +21,8 @@ import retrofit2.converter.gson.GsonConverterFactory class ApiClient( private var baseUrl: String = defaultBasePath, private val okHttpClientBuilder: OkHttpClient.Builder? = null, - private val serializerBuilder: GsonBuilder = Serializer.gsonBuilder + private val serializerBuilder: GsonBuilder = Serializer.gsonBuilder, + private val okHttpClient : OkHttpClient? = null ) { private val apiAuthorizations = mutableMapOf() var logger: ((String) -> Unit)? = null @@ -72,7 +73,7 @@ class ApiClient( baseUrl: String = defaultBasePath, okHttpClientBuilder: OkHttpClient.Builder? = null, serializerBuilder: GsonBuilder = Serializer.gsonBuilder, - authName: String, + authName: String, bearerToken: String ) : this(baseUrl, okHttpClientBuilder, serializerBuilder, arrayOf(authName)) { setBearerToken(bearerToken) @@ -82,8 +83,8 @@ class ApiClient( baseUrl: String = defaultBasePath, okHttpClientBuilder: OkHttpClient.Builder? = null, serializerBuilder: GsonBuilder = Serializer.gsonBuilder, - authName: String, - username: String, + authName: String, + username: String, password: String ) : this(baseUrl, okHttpClientBuilder, serializerBuilder, arrayOf(authName)) { setCredentials(username, password) @@ -93,10 +94,10 @@ class ApiClient( baseUrl: String = defaultBasePath, okHttpClientBuilder: OkHttpClient.Builder? = null, serializerBuilder: GsonBuilder = Serializer.gsonBuilder, - authName: String, - clientId: String, - secret: String, - username: String, + authName: String, + clientId: String, + secret: String, + username: String, password: String ) : this(baseUrl, okHttpClientBuilder, serializerBuilder, arrayOf(authName)) { getTokenEndPoint() @@ -224,7 +225,8 @@ class ApiClient( } fun createService(serviceClass: Class): S { - return retrofitBuilder.client(clientBuilder.build()).build().create(serviceClass) + val usedClient = this.okHttpClient ?: clientBuilder.build() + return retrofitBuilder.client(usedClient).build().create(serviceClass) } private fun normalizeBaseUrl() { @@ -242,10 +244,10 @@ class ApiClient( } } - companion object { + companion object { @JvmStatic val defaultBasePath: String by lazy { System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") } } -} \ No newline at end of file +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index 6465f1485531..b80e0390de2d 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -11,7 +11,6 @@ import java.util.Date object Serializer { @JvmStatic val gsonBuilder: GsonBuilder = GsonBuilder() - .registerTypeAdapter(Date::class.java, DateAdapter()) .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/FormatTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/FormatTest.kt index d69683337761..54c88ca8e900 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/FormatTest.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/FormatTest.kt @@ -26,6 +26,7 @@ import java.io.Serializable * @param int64 * @param float * @param double + * @param decimal * @param string * @param binary * @param dateTime @@ -53,6 +54,8 @@ data class FormatTest ( val float: kotlin.Float? = null, @SerializedName("double") val double: kotlin.Double? = null, + @SerializedName("decimal") + val decimal: java.math.BigDecimal? = null, @SerializedName("string") val string: kotlin.String? = null, @SerializedName("binary") diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/List.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/List.kt index 8de0d080cedc..d614d69d93bd 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/List.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/List.kt @@ -17,12 +17,12 @@ import java.io.Serializable /** * - * @param `123minusList` + * @param `123list` */ data class List ( @SerializedName("123-list") - val `123minusList`: kotlin.String? = null + val `123list`: kotlin.String? = null ) : Serializable { companion object { private const val serialVersionUID: Long = 123 diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt index 23cd075e530d..2dfb12b8b69b 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt @@ -17,12 +17,12 @@ import java.io.Serializable /** * - * @param dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket + * @param dollarSpecialPropertyName */ data class SpecialModelname ( @SerializedName("\$special[property.name]") - val dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket: kotlin.Long? = null + val dollarSpecialPropertyName: kotlin.Long? = null ) : Serializable { companion object { private const val serialVersionUID: Long = 123 diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/.openapi-generator/FILES b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/.openapi-generator/FILES index 106ea4db2ae5..2fcf69d6457e 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/.openapi-generator/FILES @@ -27,12 +27,6 @@ docs/Foo.md docs/FormatTest.md docs/HasOnlyReadOnly.md docs/HealthCheckResult.md -docs/InlineObject.md -docs/InlineObject1.md -docs/InlineObject2.md -docs/InlineObject3.md -docs/InlineObject4.md -docs/InlineObject5.md docs/InlineResponseDefault.md docs/List.md docs/MapTest.md @@ -100,12 +94,6 @@ src/main/kotlin/org/openapitools/client/models/Foo.kt src/main/kotlin/org/openapitools/client/models/FormatTest.kt src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt -src/main/kotlin/org/openapitools/client/models/InlineObject.kt -src/main/kotlin/org/openapitools/client/models/InlineObject1.kt -src/main/kotlin/org/openapitools/client/models/InlineObject2.kt -src/main/kotlin/org/openapitools/client/models/InlineObject3.kt -src/main/kotlin/org/openapitools/client/models/InlineObject4.kt -src/main/kotlin/org/openapitools/client/models/InlineObject5.kt src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt src/main/kotlin/org/openapitools/client/models/List.kt src/main/kotlin/org/openapitools/client/models/MapTest.kt diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/.openapi-generator/VERSION b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/.openapi-generator/VERSION index d99e7162d01f..3fa3b389a57d 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.0-SNAPSHOT \ No newline at end of file +5.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/README.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/README.md index 7d37a6283317..fca869bcf493 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/README.md +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/README.md @@ -101,12 +101,6 @@ Class | Method | HTTP request | Description - [org.openapitools.client.models.FormatTest](docs/FormatTest.md) - [org.openapitools.client.models.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - [org.openapitools.client.models.HealthCheckResult](docs/HealthCheckResult.md) - - [org.openapitools.client.models.InlineObject](docs/InlineObject.md) - - [org.openapitools.client.models.InlineObject1](docs/InlineObject1.md) - - [org.openapitools.client.models.InlineObject2](docs/InlineObject2.md) - - [org.openapitools.client.models.InlineObject3](docs/InlineObject3.md) - - [org.openapitools.client.models.InlineObject4](docs/InlineObject4.md) - - [org.openapitools.client.models.InlineObject5](docs/InlineObject5.md) - [org.openapitools.client.models.InlineResponseDefault](docs/InlineResponseDefault.md) - [org.openapitools.client.models.List](docs/List.md) - [org.openapitools.client.models.MapTest](docs/MapTest.md) diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/build.gradle b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/build.gradle index a6f5c0fe4927..d459b42d020b 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/build.gradle +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/build.gradle @@ -31,8 +31,9 @@ test { dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.0" compile "com.google.code.gson:gson:2.8.6" + compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.0" + compile "com.squareup.okhttp3:logging-interceptor:4.4.0" compile "io.reactivex:rxjava:$rxJavaVersion" compile "com.squareup.retrofit2:adapter-rxjava:$retrofitVersion" compile "com.squareup.retrofit2:retrofit:$retrofitVersion" diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FakeApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FakeApi.md index 6f5c1cbb479b..f94e91773ad5 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FakeApi.md @@ -440,13 +440,13 @@ To test enum parameters val apiClient = ApiClient() val webService = apiClient.createWebservice(FakeApi::class.java) -val enumHeaderStringArray : kotlin.Array = // kotlin.Array | Header parameter enum test (string array) +val enumHeaderStringArray : kotlin.collections.List = // kotlin.collections.List | Header parameter enum test (string array) val enumHeaderString : kotlin.String = enumHeaderString_example // kotlin.String | Header parameter enum test (string) -val enumQueryStringArray : kotlin.Array = // kotlin.Array | Query parameter enum test (string array) +val enumQueryStringArray : kotlin.collections.List = // kotlin.collections.List | Query parameter enum test (string array) val enumQueryString : kotlin.String = enumQueryString_example // kotlin.String | Query parameter enum test (string) val enumQueryInteger : kotlin.Int = 56 // kotlin.Int | Query parameter enum test (double) val enumQueryDouble : kotlin.Double = 1.2 // kotlin.Double | Query parameter enum test (double) -val enumFormStringArray : kotlin.Array = enumFormStringArray_example // kotlin.Array | Form parameter enum test (string array) +val enumFormStringArray : kotlin.collections.List = enumFormStringArray_example // kotlin.collections.List | Form parameter enum test (string array) val enumFormString : kotlin.String = enumFormString_example // kotlin.String | Form parameter enum test (string) webService.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) @@ -456,14 +456,14 @@ webService.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQuery Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] - **enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to "-efg"] [enum: _abc, -efg, (xyz)] - **enumQueryStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] - **enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to "-efg"] [enum: _abc, -efg, (xyz)] + **enumHeaderStringArray** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] + **enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + **enumQueryStringArray** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] + **enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumQueryInteger** | **kotlin.Int**| Query parameter enum test (double) | [optional] [enum: 1, -2] **enumQueryDouble** | **kotlin.Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] - **enumFormStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to "$"] [enum: >, $] - **enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to "-efg"] [enum: _abc, -efg, (xyz)] + **enumFormStringArray** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to $] [enum: >, $] + **enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] ### Return type @@ -617,11 +617,11 @@ To test the collection format in query parameters val apiClient = ApiClient() val webService = apiClient.createWebservice(FakeApi::class.java) -val pipe : kotlin.Array = // kotlin.Array | -val ioutil : kotlin.Array = // kotlin.Array | -val http : kotlin.Array = // kotlin.Array | -val url : kotlin.Array = // kotlin.Array | -val context : kotlin.Array = // kotlin.Array | +val pipe : kotlin.collections.List = // kotlin.collections.List | +val ioutil : kotlin.collections.List = // kotlin.collections.List | +val http : kotlin.collections.List = // kotlin.collections.List | +val url : kotlin.collections.List = // kotlin.collections.List | +val context : kotlin.collections.List = // kotlin.collections.List | webService.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) ``` @@ -630,11 +630,11 @@ webService.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pipe** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | - **ioutil** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | - **http** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | - **url** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | - **context** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **pipe** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | + **ioutil** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | + **http** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | + **url** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | + **context** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | ### Return type diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FormatTest.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FormatTest.md index 0357923c97a5..01b408499e73 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FormatTest.md +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FormatTest.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **int64** | **kotlin.Long** | | [optional] **float** | **kotlin.Float** | | [optional] **double** | **kotlin.Double** | | [optional] +**decimal** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] **string** | **kotlin.String** | | [optional] **binary** | [**java.io.File**](java.io.File.md) | | [optional] **dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/List.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/List.md index 13a09a4c4141..f426d541a409 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/List.md +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/List.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**`123minusList`** | **kotlin.String** | | [optional] +**`123list`** | **kotlin.String** | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/PetApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/PetApi.md index 7445920ab036..32d031b57a96 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/PetApi.md +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/PetApi.md @@ -103,20 +103,20 @@ Multiple status values can be provided with comma separated strings val apiClient = ApiClient() val webService = apiClient.createWebservice(PetApi::class.java) -val status : kotlin.Array = // kotlin.Array | Status values that need to be considered for filter +val status : kotlin.collections.List = // kotlin.collections.List | Status values that need to be considered for filter -val result : kotlin.Array = webService.findPetsByStatus(status) +val result : kotlin.collections.List = webService.findPetsByStatus(status) ``` ### 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] + **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] ### Return type -[**kotlin.Array<Pet>**](Pet.md) +[**kotlin.collections.List<Pet>**](Pet.md) ### Authorization @@ -141,20 +141,20 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 val apiClient = ApiClient() val webService = apiClient.createWebservice(PetApi::class.java) -val tags : kotlin.Array = // kotlin.Array | Tags to filter by +val tags : kotlin.collections.List = // kotlin.collections.List | Tags to filter by -val result : kotlin.Array = webService.findPetsByTags(tags) +val result : kotlin.collections.List = webService.findPetsByTags(tags) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Tags to filter by | + **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | ### Return type -[**kotlin.Array<Pet>**](Pet.md) +[**kotlin.collections.List<Pet>**](Pet.md) ### Authorization diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/SpecialModelName.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/SpecialModelName.md index 282649449d96..b179e705ab05 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/SpecialModelName.md +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/SpecialModelName.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **kotlin.Long** | | [optional] +**dollarSpecialPropertyName** | **kotlin.Long** | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/UserApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/UserApi.md index b667d3b0a600..bb904d243cf7 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/UserApi.md +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/UserApi.md @@ -64,7 +64,7 @@ Creates list of users with given input array val apiClient = ApiClient() val webService = apiClient.createWebservice(UserApi::class.java) -val user : kotlin.Array = // kotlin.Array | List of user object +val user : kotlin.collections.List = // kotlin.collections.List | List of user object webService.createUsersWithArrayInput(user) ``` @@ -73,7 +73,7 @@ webService.createUsersWithArrayInput(user) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.Array<User>**](User.md)| List of user object | + **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | ### Return type @@ -100,7 +100,7 @@ Creates list of users with given input array val apiClient = ApiClient() val webService = apiClient.createWebservice(UserApi::class.java) -val user : kotlin.Array = // kotlin.Array | List of user object +val user : kotlin.collections.List = // kotlin.collections.List | List of user object webService.createUsersWithListInput(user) ``` @@ -109,7 +109,7 @@ webService.createUsersWithListInput(user) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.Array<User>**](User.md)| List of user object | + **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | ### Return type diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt index e2a7aad9b72e..2a83ecce73ef 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt @@ -15,7 +15,7 @@ interface AnotherFakeApi { * - 200: successful operation * * @param client client model - * @return [Call]<[Client]> + * @return [Call]<[Client]> */ @PATCH("another-fake/dummy") fun call123testSpecialTags(@Body client: Client): Observable diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index 6d4eae90743f..c4aa25b4eeaa 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -14,7 +14,7 @@ interface DefaultApi { * Responses: * - 0: response * - * @return [Call]<[InlineResponseDefault]> + * @return [Call]<[InlineResponseDefault]> */ @GET("foo") fun fooGet(): Observable diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt index cf681d2069ce..b2971b603dd7 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt @@ -12,6 +12,8 @@ import org.openapitools.client.models.OuterComposite import org.openapitools.client.models.Pet import org.openapitools.client.models.User +import okhttp3.MultipartBody + interface FakeApi { /** * Health check endpoint @@ -19,7 +21,7 @@ interface FakeApi { * Responses: * - 200: The instance started successfully * - * @return [Call]<[HealthCheckResult]> + * @return [Call]<[HealthCheckResult]> */ @GET("fake/health") fun fakeHealthGet(): Observable @@ -33,10 +35,10 @@ interface FakeApi { * @param pet Pet object that needs to be added to the store * @param query1 query parameter (optional) * @param header1 header parameter (optional) - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @GET("fake/http-signature-test") - fun fakeHttpSignatureTest(@Body pet: Pet, @Query("query_1") query1: kotlin.String, @Header("header_1") header1: kotlin.String): Observable + fun fakeHttpSignatureTest(@Body pet: Pet, @Query("query_1") query1: kotlin.String? = null, @Header("header_1") header1: kotlin.String): Observable /** * @@ -45,7 +47,7 @@ interface FakeApi { * - 200: Output boolean * * @param body Input boolean as post body (optional) - * @return [Call]<[kotlin.Boolean]> + * @return [Call]<[kotlin.Boolean]> */ @POST("fake/outer/boolean") fun fakeOuterBooleanSerialize(@Body body: kotlin.Boolean? = null): Observable @@ -57,7 +59,7 @@ interface FakeApi { * - 200: Output composite * * @param outerComposite Input composite as post body (optional) - * @return [Call]<[OuterComposite]> + * @return [Call]<[OuterComposite]> */ @POST("fake/outer/composite") fun fakeOuterCompositeSerialize(@Body outerComposite: OuterComposite? = null): Observable @@ -69,7 +71,7 @@ interface FakeApi { * - 200: Output number * * @param body Input number as post body (optional) - * @return [Call]<[java.math.BigDecimal]> + * @return [Call]<[java.math.BigDecimal]> */ @POST("fake/outer/number") fun fakeOuterNumberSerialize(@Body body: java.math.BigDecimal? = null): Observable @@ -81,7 +83,7 @@ interface FakeApi { * - 200: Output string * * @param body Input string as post body (optional) - * @return [Call]<[kotlin.String]> + * @return [Call]<[kotlin.String]> */ @POST("fake/outer/string") fun fakeOuterStringSerialize(@Body body: kotlin.String? = null): Observable @@ -93,7 +95,7 @@ interface FakeApi { * - 200: Success * * @param fileSchemaTestClass - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @PUT("fake/body-with-file-schema") fun testBodyWithFileSchema(@Body fileSchemaTestClass: FileSchemaTestClass): Observable @@ -106,7 +108,7 @@ interface FakeApi { * * @param query * @param user - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @PUT("fake/body-with-query-params") fun testBodyWithQueryParams(@Query("query") query: kotlin.String, @Body user: User): Observable @@ -118,7 +120,7 @@ interface FakeApi { * - 200: successful operation * * @param client client model - * @return [Call]<[Client]> + * @return [Call]<[Client]> */ @PATCH("fake") fun testClientModel(@Body client: Client): Observable @@ -144,7 +146,7 @@ interface FakeApi { * @param dateTime None (optional) * @param password None (optional) * @param paramCallback None (optional) - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @FormUrlEncoded @POST("fake") @@ -158,18 +160,18 @@ interface FakeApi { * - 404: Not found * * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to "-efg") + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to "-efg") + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) * @param enumQueryInteger Query parameter enum test (double) (optional) * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to "$") - * @param enumFormString Form parameter enum test (string) (optional, default to "-efg") - * @return [Call]<[Unit]> + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return [Call]<[Unit]> */ @FormUrlEncoded @GET("fake") - fun testEnumParameters(@Header("enum_header_string_array") enumHeaderStringArray: kotlin.Array, @Header("enum_header_string") enumHeaderString: kotlin.String, @Query("enum_query_string_array") enumQueryStringArray: kotlin.Array, @Query("enum_query_string") enumQueryString: kotlin.String, @Query("enum_query_integer") enumQueryInteger: kotlin.Int, @Query("enum_query_double") enumQueryDouble: kotlin.Double, @Field("enum_form_string_array") enumFormStringArray: kotlin.Array, @Field("enum_form_string") enumFormString: kotlin.String): Observable + fun testEnumParameters(@Header("enum_header_string_array") enumHeaderStringArray: kotlin.collections.List, @Header("enum_header_string") enumHeaderString: kotlin.String, @Query("enum_query_string_array") enumQueryStringArray: kotlin.collections.List? = null, @Query("enum_query_string") enumQueryString: kotlin.String? = null, @Query("enum_query_integer") enumQueryInteger: kotlin.Int? = null, @Query("enum_query_double") enumQueryDouble: kotlin.Double? = null, @Field("enum_form_string_array") enumFormStringArray: kotlin.collections.List, @Field("enum_form_string") enumFormString: kotlin.String): Observable /** * Fake endpoint to test group parameters (optional) @@ -183,10 +185,10 @@ interface FakeApi { * @param stringGroup String in group parameters (optional) * @param booleanGroup Boolean in group parameters (optional) * @param int64Group Integer in group parameters (optional) - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @DELETE("fake") - fun testGroupParameters(@Query("required_string_group") requiredStringGroup: kotlin.Int, @Header("required_boolean_group") requiredBooleanGroup: kotlin.Boolean, @Query("required_int64_group") requiredInt64Group: kotlin.Long, @Query("string_group") stringGroup: kotlin.Int, @Header("boolean_group") booleanGroup: kotlin.Boolean, @Query("int64_group") int64Group: kotlin.Long): Observable + fun testGroupParameters(@Query("required_string_group") requiredStringGroup: kotlin.Int, @Header("required_boolean_group") requiredBooleanGroup: kotlin.Boolean, @Query("required_int64_group") requiredInt64Group: kotlin.Long, @Query("string_group") stringGroup: kotlin.Int? = null, @Header("boolean_group") booleanGroup: kotlin.Boolean, @Query("int64_group") int64Group: kotlin.Long? = null): Observable /** * test inline additionalProperties @@ -195,7 +197,7 @@ interface FakeApi { * - 200: successful operation * * @param requestBody request body - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @POST("fake/inline-additionalProperties") fun testInlineAdditionalProperties(@Body requestBody: kotlin.collections.Map): Observable @@ -208,7 +210,7 @@ interface FakeApi { * * @param param field1 * @param param2 field2 - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @FormUrlEncoded @GET("fake/jsonFormData") @@ -225,9 +227,9 @@ interface FakeApi { * @param http * @param url * @param context - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @PUT("fake/test-query-paramters") - fun testQueryParameterCollectionFormat(@Query("pipe") pipe: kotlin.Array, @Query("ioutil") ioutil: CSVParams, @Query("http") http: SSVParams, @Query("url") url: CSVParams, @Query("context") context: kotlin.Array): Observable + fun testQueryParameterCollectionFormat(@Query("pipe") pipe: kotlin.collections.List, @Query("ioutil") ioutil: CSVParams, @Query("http") http: SSVParams, @Query("url") url: CSVParams, @Query("context") context: kotlin.collections.List): Observable } diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt index 5c6c95d2db49..4a5856cdd0f4 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt @@ -15,7 +15,7 @@ interface FakeClassnameTags123Api { * - 200: successful operation * * @param client client model - * @return [Call]<[Client]> + * @return [Call]<[Client]> */ @PATCH("fake_classname_test") fun testClassname(@Body client: Client): Observable diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 8532622d6390..7564e9260dba 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -8,15 +8,18 @@ import rx.Observable import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet +import okhttp3.MultipartBody + interface PetApi { /** * Add a new pet to the store * * Responses: + * - 200: Successful operation * - 405: Invalid input * * @param pet Pet object that needs to be added to the store - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @POST("pet") fun addPet(@Body pet: Pet): Observable @@ -25,11 +28,12 @@ interface PetApi { * Deletes a pet * * Responses: + * - 200: Successful operation * - 400: Invalid pet value * * @param petId Pet id to delete * @param apiKey (optional) - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @DELETE("pet/{petId}") fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String): Observable @@ -42,10 +46,10 @@ interface PetApi { * - 400: Invalid status value * * @param status Status values that need to be considered for filter - * @return [Call]<[kotlin.Array]> + * @return [Call]<[kotlin.collections.List]> */ @GET("pet/findByStatus") - fun findPetsByStatus(@Query("status") status: CSVParams): Observable> + fun findPetsByStatus(@Query("status") status: CSVParams): Observable> /** * Finds Pets by tags @@ -55,11 +59,11 @@ interface PetApi { * - 400: Invalid tag value * * @param tags Tags to filter by - * @return [Call]<[kotlin.Array]> + * @return [Call]<[kotlin.collections.List]> */ @Deprecated("This api was deprecated") @GET("pet/findByTags") - fun findPetsByTags(@Query("tags") tags: CSVParams): Observable> + fun findPetsByTags(@Query("tags") tags: CSVParams): Observable> /** * Find pet by ID @@ -70,7 +74,7 @@ interface PetApi { * - 404: Pet not found * * @param petId ID of pet to return - * @return [Call]<[Pet]> + * @return [Call]<[Pet]> */ @GET("pet/{petId}") fun getPetById(@Path("petId") petId: kotlin.Long): Observable @@ -79,12 +83,13 @@ interface PetApi { * Update an existing pet * * Responses: + * - 200: Successful operation * - 400: Invalid ID supplied * - 404: Pet not found * - 405: Validation exception * * @param pet Pet object that needs to be added to the store - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @PUT("pet") fun updatePet(@Body pet: Pet): Observable @@ -93,12 +98,13 @@ interface PetApi { * Updates a pet in the store with form data * * Responses: + * - 200: Successful operation * - 405: Invalid input * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @FormUrlEncoded @POST("pet/{petId}") @@ -113,7 +119,7 @@ interface PetApi { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return [Call]<[ApiResponse]> + * @return [Call]<[ApiResponse]> */ @Multipart @POST("pet/{petId}/uploadImage") @@ -128,7 +134,7 @@ interface PetApi { * @param petId ID of pet to update * @param requiredFile file to upload * @param additionalMetadata Additional data to pass to server (optional) - * @return [Call]<[ApiResponse]> + * @return [Call]<[ApiResponse]> */ @Multipart @POST("fake/{petId}/uploadImageWithRequiredFile") diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index fef564f9465f..5b2aabc8fd65 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -16,7 +16,7 @@ interface StoreApi { * - 404: Order not found * * @param orderId ID of the order that needs to be deleted - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @DELETE("store/order/{order_id}") fun deleteOrder(@Path("order_id") orderId: kotlin.String): Observable @@ -27,7 +27,7 @@ interface StoreApi { * Responses: * - 200: successful operation * - * @return [Call]<[kotlin.collections.Map]> + * @return [Call]<[kotlin.collections.Map]> */ @GET("store/inventory") fun getInventory(): Observable> @@ -41,7 +41,7 @@ interface StoreApi { * - 404: Order not found * * @param orderId ID of pet that needs to be fetched - * @return [Call]<[Order]> + * @return [Call]<[Order]> */ @GET("store/order/{order_id}") fun getOrderById(@Path("order_id") orderId: kotlin.Long): Observable @@ -54,7 +54,7 @@ interface StoreApi { * - 400: Invalid Order * * @param order order placed for purchasing the pet - * @return [Call]<[Order]> + * @return [Call]<[Order]> */ @POST("store/order") fun placeOrder(@Body order: Order): Observable diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 465705c8ef72..6884a8b85c1e 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -15,7 +15,7 @@ interface UserApi { * - 0: successful operation * * @param user Created user object - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @POST("user") fun createUser(@Body user: User): Observable @@ -27,10 +27,10 @@ interface UserApi { * - 0: successful operation * * @param user List of user object - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @POST("user/createWithArray") - fun createUsersWithArrayInput(@Body user: kotlin.Array): Observable + fun createUsersWithArrayInput(@Body user: kotlin.collections.List): Observable /** * Creates list of users with given input array @@ -39,10 +39,10 @@ interface UserApi { * - 0: successful operation * * @param user List of user object - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @POST("user/createWithList") - fun createUsersWithListInput(@Body user: kotlin.Array): Observable + fun createUsersWithListInput(@Body user: kotlin.collections.List): Observable /** * Delete user @@ -52,7 +52,7 @@ interface UserApi { * - 404: User not found * * @param username The name that needs to be deleted - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @DELETE("user/{username}") fun deleteUser(@Path("username") username: kotlin.String): Observable @@ -66,7 +66,7 @@ interface UserApi { * - 404: User not found * * @param username The name that needs to be fetched. Use user1 for testing. - * @return [Call]<[User]> + * @return [Call]<[User]> */ @GET("user/{username}") fun getUserByName(@Path("username") username: kotlin.String): Observable @@ -80,7 +80,7 @@ interface UserApi { * * @param username The user name for login * @param password The password for login in clear text - * @return [Call]<[kotlin.String]> + * @return [Call]<[kotlin.String]> */ @GET("user/login") fun loginUser(@Query("username") username: kotlin.String, @Query("password") password: kotlin.String): Observable @@ -91,7 +91,7 @@ interface UserApi { * Responses: * - 0: successful operation * - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @GET("user/logout") fun logoutUser(): Observable @@ -105,7 +105,7 @@ interface UserApi { * * @param username name that need to be deleted * @param user Updated user object - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @PUT("user/{username}") fun updateUser(@Path("username") username: kotlin.String, @Body user: User): Observable diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index eaf1cd79b17f..656b5e261e8f 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -22,7 +22,8 @@ import retrofit2.converter.gson.GsonConverterFactory class ApiClient( private var baseUrl: String = defaultBasePath, private val okHttpClientBuilder: OkHttpClient.Builder? = null, - private val serializerBuilder: GsonBuilder = Serializer.gsonBuilder + private val serializerBuilder: GsonBuilder = Serializer.gsonBuilder, + private val okHttpClient : OkHttpClient? = null ) { private val apiAuthorizations = mutableMapOf() var logger: ((String) -> Unit)? = null @@ -74,7 +75,7 @@ class ApiClient( baseUrl: String = defaultBasePath, okHttpClientBuilder: OkHttpClient.Builder? = null, serializerBuilder: GsonBuilder = Serializer.gsonBuilder, - authName: String, + authName: String, bearerToken: String ) : this(baseUrl, okHttpClientBuilder, serializerBuilder, arrayOf(authName)) { setBearerToken(bearerToken) @@ -84,8 +85,8 @@ class ApiClient( baseUrl: String = defaultBasePath, okHttpClientBuilder: OkHttpClient.Builder? = null, serializerBuilder: GsonBuilder = Serializer.gsonBuilder, - authName: String, - username: String, + authName: String, + username: String, password: String ) : this(baseUrl, okHttpClientBuilder, serializerBuilder, arrayOf(authName)) { setCredentials(username, password) @@ -95,10 +96,10 @@ class ApiClient( baseUrl: String = defaultBasePath, okHttpClientBuilder: OkHttpClient.Builder? = null, serializerBuilder: GsonBuilder = Serializer.gsonBuilder, - authName: String, - clientId: String, - secret: String, - username: String, + authName: String, + clientId: String, + secret: String, + username: String, password: String ) : this(baseUrl, okHttpClientBuilder, serializerBuilder, arrayOf(authName)) { getTokenEndPoint() @@ -226,7 +227,8 @@ class ApiClient( } fun createService(serviceClass: Class): S { - return retrofitBuilder.client(clientBuilder.build()).build().create(serviceClass) + val usedClient = this.okHttpClient ?: clientBuilder.build() + return retrofitBuilder.client(usedClient).build().create(serviceClass) } private fun normalizeBaseUrl() { @@ -244,10 +246,10 @@ class ApiClient( } } - companion object { + companion object { @JvmStatic val defaultBasePath: String by lazy { System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") } } -} \ No newline at end of file +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index 6465f1485531..b80e0390de2d 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -11,7 +11,6 @@ import java.util.Date object Serializer { @JvmStatic val gsonBuilder: GsonBuilder = GsonBuilder() - .registerTypeAdapter(Date::class.java, DateAdapter()) .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/FormatTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/FormatTest.kt index d69683337761..54c88ca8e900 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/FormatTest.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/FormatTest.kt @@ -26,6 +26,7 @@ import java.io.Serializable * @param int64 * @param float * @param double + * @param decimal * @param string * @param binary * @param dateTime @@ -53,6 +54,8 @@ data class FormatTest ( val float: kotlin.Float? = null, @SerializedName("double") val double: kotlin.Double? = null, + @SerializedName("decimal") + val decimal: java.math.BigDecimal? = null, @SerializedName("string") val string: kotlin.String? = null, @SerializedName("binary") diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/List.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/List.kt index 8de0d080cedc..d614d69d93bd 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/List.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/List.kt @@ -17,12 +17,12 @@ import java.io.Serializable /** * - * @param `123minusList` + * @param `123list` */ data class List ( @SerializedName("123-list") - val `123minusList`: kotlin.String? = null + val `123list`: kotlin.String? = null ) : Serializable { companion object { private const val serialVersionUID: Long = 123 diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt index 23cd075e530d..2dfb12b8b69b 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt @@ -17,12 +17,12 @@ import java.io.Serializable /** * - * @param dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket + * @param dollarSpecialPropertyName */ data class SpecialModelname ( @SerializedName("\$special[property.name]") - val dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket: kotlin.Long? = null + val dollarSpecialPropertyName: kotlin.Long? = null ) : Serializable { companion object { private const val serialVersionUID: Long = 123 diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/.openapi-generator/FILES b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/.openapi-generator/FILES index 106ea4db2ae5..2fcf69d6457e 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/.openapi-generator/FILES @@ -27,12 +27,6 @@ docs/Foo.md docs/FormatTest.md docs/HasOnlyReadOnly.md docs/HealthCheckResult.md -docs/InlineObject.md -docs/InlineObject1.md -docs/InlineObject2.md -docs/InlineObject3.md -docs/InlineObject4.md -docs/InlineObject5.md docs/InlineResponseDefault.md docs/List.md docs/MapTest.md @@ -100,12 +94,6 @@ src/main/kotlin/org/openapitools/client/models/Foo.kt src/main/kotlin/org/openapitools/client/models/FormatTest.kt src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt -src/main/kotlin/org/openapitools/client/models/InlineObject.kt -src/main/kotlin/org/openapitools/client/models/InlineObject1.kt -src/main/kotlin/org/openapitools/client/models/InlineObject2.kt -src/main/kotlin/org/openapitools/client/models/InlineObject3.kt -src/main/kotlin/org/openapitools/client/models/InlineObject4.kt -src/main/kotlin/org/openapitools/client/models/InlineObject5.kt src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt src/main/kotlin/org/openapitools/client/models/List.kt src/main/kotlin/org/openapitools/client/models/MapTest.kt diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/.openapi-generator/VERSION b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/.openapi-generator/VERSION index d99e7162d01f..3fa3b389a57d 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.0-SNAPSHOT \ No newline at end of file +5.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/README.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/README.md index 7d37a6283317..fca869bcf493 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/README.md +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/README.md @@ -101,12 +101,6 @@ Class | Method | HTTP request | Description - [org.openapitools.client.models.FormatTest](docs/FormatTest.md) - [org.openapitools.client.models.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - [org.openapitools.client.models.HealthCheckResult](docs/HealthCheckResult.md) - - [org.openapitools.client.models.InlineObject](docs/InlineObject.md) - - [org.openapitools.client.models.InlineObject1](docs/InlineObject1.md) - - [org.openapitools.client.models.InlineObject2](docs/InlineObject2.md) - - [org.openapitools.client.models.InlineObject3](docs/InlineObject3.md) - - [org.openapitools.client.models.InlineObject4](docs/InlineObject4.md) - - [org.openapitools.client.models.InlineObject5](docs/InlineObject5.md) - [org.openapitools.client.models.InlineResponseDefault](docs/InlineResponseDefault.md) - [org.openapitools.client.models.List](docs/List.md) - [org.openapitools.client.models.MapTest](docs/MapTest.md) diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/build.gradle b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/build.gradle index 0f07a7da1243..745b5ece43de 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/build.gradle +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/build.gradle @@ -31,8 +31,9 @@ test { dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.0" compile "com.google.code.gson:gson:2.8.6" + compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.0" + compile "com.squareup.okhttp3:logging-interceptor:4.4.0" compile "io.reactivex.rxjava2:rxjava:$rxJava2Version" compile "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion" compile "com.squareup.retrofit2:retrofit:$retrofitVersion" diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FakeApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FakeApi.md index 6f5c1cbb479b..f94e91773ad5 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FakeApi.md @@ -440,13 +440,13 @@ To test enum parameters val apiClient = ApiClient() val webService = apiClient.createWebservice(FakeApi::class.java) -val enumHeaderStringArray : kotlin.Array = // kotlin.Array | Header parameter enum test (string array) +val enumHeaderStringArray : kotlin.collections.List = // kotlin.collections.List | Header parameter enum test (string array) val enumHeaderString : kotlin.String = enumHeaderString_example // kotlin.String | Header parameter enum test (string) -val enumQueryStringArray : kotlin.Array = // kotlin.Array | Query parameter enum test (string array) +val enumQueryStringArray : kotlin.collections.List = // kotlin.collections.List | Query parameter enum test (string array) val enumQueryString : kotlin.String = enumQueryString_example // kotlin.String | Query parameter enum test (string) val enumQueryInteger : kotlin.Int = 56 // kotlin.Int | Query parameter enum test (double) val enumQueryDouble : kotlin.Double = 1.2 // kotlin.Double | Query parameter enum test (double) -val enumFormStringArray : kotlin.Array = enumFormStringArray_example // kotlin.Array | Form parameter enum test (string array) +val enumFormStringArray : kotlin.collections.List = enumFormStringArray_example // kotlin.collections.List | Form parameter enum test (string array) val enumFormString : kotlin.String = enumFormString_example // kotlin.String | Form parameter enum test (string) webService.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) @@ -456,14 +456,14 @@ webService.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQuery Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] - **enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to "-efg"] [enum: _abc, -efg, (xyz)] - **enumQueryStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] - **enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to "-efg"] [enum: _abc, -efg, (xyz)] + **enumHeaderStringArray** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] + **enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + **enumQueryStringArray** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] + **enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumQueryInteger** | **kotlin.Int**| Query parameter enum test (double) | [optional] [enum: 1, -2] **enumQueryDouble** | **kotlin.Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] - **enumFormStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to "$"] [enum: >, $] - **enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to "-efg"] [enum: _abc, -efg, (xyz)] + **enumFormStringArray** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to $] [enum: >, $] + **enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] ### Return type @@ -617,11 +617,11 @@ To test the collection format in query parameters val apiClient = ApiClient() val webService = apiClient.createWebservice(FakeApi::class.java) -val pipe : kotlin.Array = // kotlin.Array | -val ioutil : kotlin.Array = // kotlin.Array | -val http : kotlin.Array = // kotlin.Array | -val url : kotlin.Array = // kotlin.Array | -val context : kotlin.Array = // kotlin.Array | +val pipe : kotlin.collections.List = // kotlin.collections.List | +val ioutil : kotlin.collections.List = // kotlin.collections.List | +val http : kotlin.collections.List = // kotlin.collections.List | +val url : kotlin.collections.List = // kotlin.collections.List | +val context : kotlin.collections.List = // kotlin.collections.List | webService.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) ``` @@ -630,11 +630,11 @@ webService.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pipe** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | - **ioutil** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | - **http** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | - **url** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | - **context** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **pipe** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | + **ioutil** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | + **http** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | + **url** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | + **context** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | ### Return type diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FormatTest.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FormatTest.md index 0357923c97a5..01b408499e73 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FormatTest.md +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FormatTest.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **int64** | **kotlin.Long** | | [optional] **float** | **kotlin.Float** | | [optional] **double** | **kotlin.Double** | | [optional] +**decimal** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] **string** | **kotlin.String** | | [optional] **binary** | [**java.io.File**](java.io.File.md) | | [optional] **dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/List.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/List.md index 13a09a4c4141..f426d541a409 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/List.md +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/List.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**`123minusList`** | **kotlin.String** | | [optional] +**`123list`** | **kotlin.String** | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/PetApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/PetApi.md index 7445920ab036..32d031b57a96 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/PetApi.md +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/PetApi.md @@ -103,20 +103,20 @@ Multiple status values can be provided with comma separated strings val apiClient = ApiClient() val webService = apiClient.createWebservice(PetApi::class.java) -val status : kotlin.Array = // kotlin.Array | Status values that need to be considered for filter +val status : kotlin.collections.List = // kotlin.collections.List | Status values that need to be considered for filter -val result : kotlin.Array = webService.findPetsByStatus(status) +val result : kotlin.collections.List = webService.findPetsByStatus(status) ``` ### 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] + **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] ### Return type -[**kotlin.Array<Pet>**](Pet.md) +[**kotlin.collections.List<Pet>**](Pet.md) ### Authorization @@ -141,20 +141,20 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 val apiClient = ApiClient() val webService = apiClient.createWebservice(PetApi::class.java) -val tags : kotlin.Array = // kotlin.Array | Tags to filter by +val tags : kotlin.collections.List = // kotlin.collections.List | Tags to filter by -val result : kotlin.Array = webService.findPetsByTags(tags) +val result : kotlin.collections.List = webService.findPetsByTags(tags) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Tags to filter by | + **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | ### Return type -[**kotlin.Array<Pet>**](Pet.md) +[**kotlin.collections.List<Pet>**](Pet.md) ### Authorization diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/SpecialModelName.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/SpecialModelName.md index 282649449d96..b179e705ab05 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/SpecialModelName.md +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/SpecialModelName.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **kotlin.Long** | | [optional] +**dollarSpecialPropertyName** | **kotlin.Long** | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/UserApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/UserApi.md index b667d3b0a600..bb904d243cf7 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/UserApi.md +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/UserApi.md @@ -64,7 +64,7 @@ Creates list of users with given input array val apiClient = ApiClient() val webService = apiClient.createWebservice(UserApi::class.java) -val user : kotlin.Array = // kotlin.Array | List of user object +val user : kotlin.collections.List = // kotlin.collections.List | List of user object webService.createUsersWithArrayInput(user) ``` @@ -73,7 +73,7 @@ webService.createUsersWithArrayInput(user) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.Array<User>**](User.md)| List of user object | + **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | ### Return type @@ -100,7 +100,7 @@ Creates list of users with given input array val apiClient = ApiClient() val webService = apiClient.createWebservice(UserApi::class.java) -val user : kotlin.Array = // kotlin.Array | List of user object +val user : kotlin.collections.List = // kotlin.collections.List | List of user object webService.createUsersWithListInput(user) ``` @@ -109,7 +109,7 @@ webService.createUsersWithListInput(user) Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.Array<User>**](User.md)| List of user object | + **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | ### Return type diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt index 21fe5e2e2afb..269f69f3fee1 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt @@ -16,7 +16,7 @@ interface AnotherFakeApi { * - 200: successful operation * * @param client client model - * @return [Call]<[Client]> + * @return [Call]<[Client]> */ @PATCH("another-fake/dummy") fun call123testSpecialTags(@Body client: Client): Single diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index 7ccf2391af88..9247827ae175 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -15,7 +15,7 @@ interface DefaultApi { * Responses: * - 0: response * - * @return [Call]<[InlineResponseDefault]> + * @return [Call]<[InlineResponseDefault]> */ @GET("foo") fun fooGet(): Single diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt index 079756251046..19579ff31393 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt @@ -13,6 +13,8 @@ import org.openapitools.client.models.OuterComposite import org.openapitools.client.models.Pet import org.openapitools.client.models.User +import okhttp3.MultipartBody + interface FakeApi { /** * Health check endpoint @@ -20,7 +22,7 @@ interface FakeApi { * Responses: * - 200: The instance started successfully * - * @return [Call]<[HealthCheckResult]> + * @return [Call]<[HealthCheckResult]> */ @GET("fake/health") fun fakeHealthGet(): Single @@ -34,10 +36,10 @@ interface FakeApi { * @param pet Pet object that needs to be added to the store * @param query1 query parameter (optional) * @param header1 header parameter (optional) - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @GET("fake/http-signature-test") - fun fakeHttpSignatureTest(@Body pet: Pet, @Query("query_1") query1: kotlin.String, @Header("header_1") header1: kotlin.String): Completable + fun fakeHttpSignatureTest(@Body pet: Pet, @Query("query_1") query1: kotlin.String? = null, @Header("header_1") header1: kotlin.String): Completable /** * @@ -46,7 +48,7 @@ interface FakeApi { * - 200: Output boolean * * @param body Input boolean as post body (optional) - * @return [Call]<[kotlin.Boolean]> + * @return [Call]<[kotlin.Boolean]> */ @POST("fake/outer/boolean") fun fakeOuterBooleanSerialize(@Body body: kotlin.Boolean? = null): Single @@ -58,7 +60,7 @@ interface FakeApi { * - 200: Output composite * * @param outerComposite Input composite as post body (optional) - * @return [Call]<[OuterComposite]> + * @return [Call]<[OuterComposite]> */ @POST("fake/outer/composite") fun fakeOuterCompositeSerialize(@Body outerComposite: OuterComposite? = null): Single @@ -70,7 +72,7 @@ interface FakeApi { * - 200: Output number * * @param body Input number as post body (optional) - * @return [Call]<[java.math.BigDecimal]> + * @return [Call]<[java.math.BigDecimal]> */ @POST("fake/outer/number") fun fakeOuterNumberSerialize(@Body body: java.math.BigDecimal? = null): Single @@ -82,7 +84,7 @@ interface FakeApi { * - 200: Output string * * @param body Input string as post body (optional) - * @return [Call]<[kotlin.String]> + * @return [Call]<[kotlin.String]> */ @POST("fake/outer/string") fun fakeOuterStringSerialize(@Body body: kotlin.String? = null): Single @@ -94,7 +96,7 @@ interface FakeApi { * - 200: Success * * @param fileSchemaTestClass - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @PUT("fake/body-with-file-schema") fun testBodyWithFileSchema(@Body fileSchemaTestClass: FileSchemaTestClass): Completable @@ -107,7 +109,7 @@ interface FakeApi { * * @param query * @param user - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @PUT("fake/body-with-query-params") fun testBodyWithQueryParams(@Query("query") query: kotlin.String, @Body user: User): Completable @@ -119,7 +121,7 @@ interface FakeApi { * - 200: successful operation * * @param client client model - * @return [Call]<[Client]> + * @return [Call]<[Client]> */ @PATCH("fake") fun testClientModel(@Body client: Client): Single @@ -145,7 +147,7 @@ interface FakeApi { * @param dateTime None (optional) * @param password None (optional) * @param paramCallback None (optional) - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @FormUrlEncoded @POST("fake") @@ -159,18 +161,18 @@ interface FakeApi { * - 404: Not found * * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to "-efg") + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to "-efg") + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) * @param enumQueryInteger Query parameter enum test (double) (optional) * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to "$") - * @param enumFormString Form parameter enum test (string) (optional, default to "-efg") - * @return [Call]<[Unit]> + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return [Call]<[Unit]> */ @FormUrlEncoded @GET("fake") - fun testEnumParameters(@Header("enum_header_string_array") enumHeaderStringArray: kotlin.Array, @Header("enum_header_string") enumHeaderString: kotlin.String, @Query("enum_query_string_array") enumQueryStringArray: kotlin.Array, @Query("enum_query_string") enumQueryString: kotlin.String, @Query("enum_query_integer") enumQueryInteger: kotlin.Int, @Query("enum_query_double") enumQueryDouble: kotlin.Double, @Field("enum_form_string_array") enumFormStringArray: kotlin.Array, @Field("enum_form_string") enumFormString: kotlin.String): Completable + fun testEnumParameters(@Header("enum_header_string_array") enumHeaderStringArray: kotlin.collections.List, @Header("enum_header_string") enumHeaderString: kotlin.String, @Query("enum_query_string_array") enumQueryStringArray: kotlin.collections.List? = null, @Query("enum_query_string") enumQueryString: kotlin.String? = null, @Query("enum_query_integer") enumQueryInteger: kotlin.Int? = null, @Query("enum_query_double") enumQueryDouble: kotlin.Double? = null, @Field("enum_form_string_array") enumFormStringArray: kotlin.collections.List, @Field("enum_form_string") enumFormString: kotlin.String): Completable /** * Fake endpoint to test group parameters (optional) @@ -184,10 +186,10 @@ interface FakeApi { * @param stringGroup String in group parameters (optional) * @param booleanGroup Boolean in group parameters (optional) * @param int64Group Integer in group parameters (optional) - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @DELETE("fake") - fun testGroupParameters(@Query("required_string_group") requiredStringGroup: kotlin.Int, @Header("required_boolean_group") requiredBooleanGroup: kotlin.Boolean, @Query("required_int64_group") requiredInt64Group: kotlin.Long, @Query("string_group") stringGroup: kotlin.Int, @Header("boolean_group") booleanGroup: kotlin.Boolean, @Query("int64_group") int64Group: kotlin.Long): Completable + fun testGroupParameters(@Query("required_string_group") requiredStringGroup: kotlin.Int, @Header("required_boolean_group") requiredBooleanGroup: kotlin.Boolean, @Query("required_int64_group") requiredInt64Group: kotlin.Long, @Query("string_group") stringGroup: kotlin.Int? = null, @Header("boolean_group") booleanGroup: kotlin.Boolean, @Query("int64_group") int64Group: kotlin.Long? = null): Completable /** * test inline additionalProperties @@ -196,7 +198,7 @@ interface FakeApi { * - 200: successful operation * * @param requestBody request body - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @POST("fake/inline-additionalProperties") fun testInlineAdditionalProperties(@Body requestBody: kotlin.collections.Map): Completable @@ -209,7 +211,7 @@ interface FakeApi { * * @param param field1 * @param param2 field2 - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @FormUrlEncoded @GET("fake/jsonFormData") @@ -226,9 +228,9 @@ interface FakeApi { * @param http * @param url * @param context - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @PUT("fake/test-query-paramters") - fun testQueryParameterCollectionFormat(@Query("pipe") pipe: kotlin.Array, @Query("ioutil") ioutil: CSVParams, @Query("http") http: SSVParams, @Query("url") url: CSVParams, @Query("context") context: kotlin.Array): Completable + fun testQueryParameterCollectionFormat(@Query("pipe") pipe: kotlin.collections.List, @Query("ioutil") ioutil: CSVParams, @Query("http") http: SSVParams, @Query("url") url: CSVParams, @Query("context") context: kotlin.collections.List): Completable } diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt index d55a974eb115..518a75780ffa 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt @@ -16,7 +16,7 @@ interface FakeClassnameTags123Api { * - 200: successful operation * * @param client client model - * @return [Call]<[Client]> + * @return [Call]<[Client]> */ @PATCH("fake_classname_test") fun testClassname(@Body client: Client): Single diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 75c7a7051e84..82c0bc4b59f1 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -9,15 +9,18 @@ import io.reactivex.Completable import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet +import okhttp3.MultipartBody + interface PetApi { /** * Add a new pet to the store * * Responses: + * - 200: Successful operation * - 405: Invalid input * * @param pet Pet object that needs to be added to the store - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @POST("pet") fun addPet(@Body pet: Pet): Completable @@ -26,11 +29,12 @@ interface PetApi { * Deletes a pet * * Responses: + * - 200: Successful operation * - 400: Invalid pet value * * @param petId Pet id to delete * @param apiKey (optional) - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @DELETE("pet/{petId}") fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String): Completable @@ -43,10 +47,10 @@ interface PetApi { * - 400: Invalid status value * * @param status Status values that need to be considered for filter - * @return [Call]<[kotlin.Array]> + * @return [Call]<[kotlin.collections.List]> */ @GET("pet/findByStatus") - fun findPetsByStatus(@Query("status") status: CSVParams): Single> + fun findPetsByStatus(@Query("status") status: CSVParams): Single> /** * Finds Pets by tags @@ -56,11 +60,11 @@ interface PetApi { * - 400: Invalid tag value * * @param tags Tags to filter by - * @return [Call]<[kotlin.Array]> + * @return [Call]<[kotlin.collections.List]> */ @Deprecated("This api was deprecated") @GET("pet/findByTags") - fun findPetsByTags(@Query("tags") tags: CSVParams): Single> + fun findPetsByTags(@Query("tags") tags: CSVParams): Single> /** * Find pet by ID @@ -71,7 +75,7 @@ interface PetApi { * - 404: Pet not found * * @param petId ID of pet to return - * @return [Call]<[Pet]> + * @return [Call]<[Pet]> */ @GET("pet/{petId}") fun getPetById(@Path("petId") petId: kotlin.Long): Single @@ -80,12 +84,13 @@ interface PetApi { * Update an existing pet * * Responses: + * - 200: Successful operation * - 400: Invalid ID supplied * - 404: Pet not found * - 405: Validation exception * * @param pet Pet object that needs to be added to the store - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @PUT("pet") fun updatePet(@Body pet: Pet): Completable @@ -94,12 +99,13 @@ interface PetApi { * Updates a pet in the store with form data * * Responses: + * - 200: Successful operation * - 405: Invalid input * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @FormUrlEncoded @POST("pet/{petId}") @@ -114,7 +120,7 @@ interface PetApi { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return [Call]<[ApiResponse]> + * @return [Call]<[ApiResponse]> */ @Multipart @POST("pet/{petId}/uploadImage") @@ -129,7 +135,7 @@ interface PetApi { * @param petId ID of pet to update * @param requiredFile file to upload * @param additionalMetadata Additional data to pass to server (optional) - * @return [Call]<[ApiResponse]> + * @return [Call]<[ApiResponse]> */ @Multipart @POST("fake/{petId}/uploadImageWithRequiredFile") diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 1b55d025d063..6c489f464070 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -17,7 +17,7 @@ interface StoreApi { * - 404: Order not found * * @param orderId ID of the order that needs to be deleted - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @DELETE("store/order/{order_id}") fun deleteOrder(@Path("order_id") orderId: kotlin.String): Completable @@ -28,7 +28,7 @@ interface StoreApi { * Responses: * - 200: successful operation * - * @return [Call]<[kotlin.collections.Map]> + * @return [Call]<[kotlin.collections.Map]> */ @GET("store/inventory") fun getInventory(): Single> @@ -42,7 +42,7 @@ interface StoreApi { * - 404: Order not found * * @param orderId ID of pet that needs to be fetched - * @return [Call]<[Order]> + * @return [Call]<[Order]> */ @GET("store/order/{order_id}") fun getOrderById(@Path("order_id") orderId: kotlin.Long): Single @@ -55,7 +55,7 @@ interface StoreApi { * - 400: Invalid Order * * @param order order placed for purchasing the pet - * @return [Call]<[Order]> + * @return [Call]<[Order]> */ @POST("store/order") fun placeOrder(@Body order: Order): Single diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 0948c0c47a79..eceeeb29d9c4 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -16,7 +16,7 @@ interface UserApi { * - 0: successful operation * * @param user Created user object - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @POST("user") fun createUser(@Body user: User): Completable @@ -28,10 +28,10 @@ interface UserApi { * - 0: successful operation * * @param user List of user object - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @POST("user/createWithArray") - fun createUsersWithArrayInput(@Body user: kotlin.Array): Completable + fun createUsersWithArrayInput(@Body user: kotlin.collections.List): Completable /** * Creates list of users with given input array @@ -40,10 +40,10 @@ interface UserApi { * - 0: successful operation * * @param user List of user object - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @POST("user/createWithList") - fun createUsersWithListInput(@Body user: kotlin.Array): Completable + fun createUsersWithListInput(@Body user: kotlin.collections.List): Completable /** * Delete user @@ -53,7 +53,7 @@ interface UserApi { * - 404: User not found * * @param username The name that needs to be deleted - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @DELETE("user/{username}") fun deleteUser(@Path("username") username: kotlin.String): Completable @@ -67,7 +67,7 @@ interface UserApi { * - 404: User not found * * @param username The name that needs to be fetched. Use user1 for testing. - * @return [Call]<[User]> + * @return [Call]<[User]> */ @GET("user/{username}") fun getUserByName(@Path("username") username: kotlin.String): Single @@ -81,7 +81,7 @@ interface UserApi { * * @param username The user name for login * @param password The password for login in clear text - * @return [Call]<[kotlin.String]> + * @return [Call]<[kotlin.String]> */ @GET("user/login") fun loginUser(@Query("username") username: kotlin.String, @Query("password") password: kotlin.String): Single @@ -92,7 +92,7 @@ interface UserApi { * Responses: * - 0: successful operation * - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @GET("user/logout") fun logoutUser(): Completable @@ -106,7 +106,7 @@ interface UserApi { * * @param username name that need to be deleted * @param user Updated user object - * @return [Call]<[Unit]> + * @return [Call]<[Unit]> */ @PUT("user/{username}") fun updateUser(@Path("username") username: kotlin.String, @Body user: User): Completable diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 1e9f9e39d85d..1691620ea5e1 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -22,7 +22,8 @@ import retrofit2.converter.gson.GsonConverterFactory class ApiClient( private var baseUrl: String = defaultBasePath, private val okHttpClientBuilder: OkHttpClient.Builder? = null, - private val serializerBuilder: GsonBuilder = Serializer.gsonBuilder + private val serializerBuilder: GsonBuilder = Serializer.gsonBuilder, + private val okHttpClient : OkHttpClient? = null ) { private val apiAuthorizations = mutableMapOf() var logger: ((String) -> Unit)? = null @@ -33,7 +34,7 @@ class ApiClient( .addConverterFactory(ScalarsConverterFactory.create()) .addConverterFactory(GsonConverterFactory.create(serializerBuilder.create())) .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) - } + } private val clientBuilder: OkHttpClient.Builder by lazy { okHttpClientBuilder ?: defaultClientBuilder @@ -74,7 +75,7 @@ class ApiClient( baseUrl: String = defaultBasePath, okHttpClientBuilder: OkHttpClient.Builder? = null, serializerBuilder: GsonBuilder = Serializer.gsonBuilder, - authName: String, + authName: String, bearerToken: String ) : this(baseUrl, okHttpClientBuilder, serializerBuilder, arrayOf(authName)) { setBearerToken(bearerToken) @@ -84,8 +85,8 @@ class ApiClient( baseUrl: String = defaultBasePath, okHttpClientBuilder: OkHttpClient.Builder? = null, serializerBuilder: GsonBuilder = Serializer.gsonBuilder, - authName: String, - username: String, + authName: String, + username: String, password: String ) : this(baseUrl, okHttpClientBuilder, serializerBuilder, arrayOf(authName)) { setCredentials(username, password) @@ -95,10 +96,10 @@ class ApiClient( baseUrl: String = defaultBasePath, okHttpClientBuilder: OkHttpClient.Builder? = null, serializerBuilder: GsonBuilder = Serializer.gsonBuilder, - authName: String, - clientId: String, - secret: String, - username: String, + authName: String, + clientId: String, + secret: String, + username: String, password: String ) : this(baseUrl, okHttpClientBuilder, serializerBuilder, arrayOf(authName)) { getTokenEndPoint() @@ -226,7 +227,8 @@ class ApiClient( } fun createService(serviceClass: Class): S { - return retrofitBuilder.client(clientBuilder.build()).build().create(serviceClass) + val usedClient = this.okHttpClient ?: clientBuilder.build() + return retrofitBuilder.client(usedClient).build().create(serviceClass) } private fun normalizeBaseUrl() { @@ -244,10 +246,10 @@ class ApiClient( } } - companion object { + companion object { @JvmStatic val defaultBasePath: String by lazy { System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") } } -} \ No newline at end of file +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index 6465f1485531..b80e0390de2d 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -11,7 +11,6 @@ import java.util.Date object Serializer { @JvmStatic val gsonBuilder: GsonBuilder = GsonBuilder() - .registerTypeAdapter(Date::class.java, DateAdapter()) .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/FormatTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/FormatTest.kt index d69683337761..54c88ca8e900 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/FormatTest.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/FormatTest.kt @@ -26,6 +26,7 @@ import java.io.Serializable * @param int64 * @param float * @param double + * @param decimal * @param string * @param binary * @param dateTime @@ -53,6 +54,8 @@ data class FormatTest ( val float: kotlin.Float? = null, @SerializedName("double") val double: kotlin.Double? = null, + @SerializedName("decimal") + val decimal: java.math.BigDecimal? = null, @SerializedName("string") val string: kotlin.String? = null, @SerializedName("binary") diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/List.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/List.kt index 8de0d080cedc..d614d69d93bd 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/List.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/List.kt @@ -17,12 +17,12 @@ import java.io.Serializable /** * - * @param `123minusList` + * @param `123list` */ data class List ( @SerializedName("123-list") - val `123minusList`: kotlin.String? = null + val `123list`: kotlin.String? = null ) : Serializable { companion object { private const val serialVersionUID: Long = 123 diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt index 23cd075e530d..2dfb12b8b69b 100644 --- a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt @@ -17,12 +17,12 @@ import java.io.Serializable /** * - * @param dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket + * @param dollarSpecialPropertyName */ data class SpecialModelname ( @SerializedName("\$special[property.name]") - val dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket: kotlin.Long? = null + val dollarSpecialPropertyName: kotlin.Long? = null ) : Serializable { companion object { private const val serialVersionUID: Long = 123 diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/.openapi-generator/FILES b/samples/openapi3/client/petstore/kotlin-multiplatform/.openapi-generator/FILES index 17ac9baa409d..f350611489a0 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/.openapi-generator/FILES @@ -27,12 +27,6 @@ docs/Foo.md docs/FormatTest.md docs/HasOnlyReadOnly.md docs/HealthCheckResult.md -docs/InlineObject.md -docs/InlineObject1.md -docs/InlineObject2.md -docs/InlineObject3.md -docs/InlineObject4.md -docs/InlineObject5.md docs/InlineResponseDefault.md docs/List.md docs/MapTest.md @@ -102,12 +96,6 @@ src/commonMain/kotlin/org/openapitools/client/models/Foo.kt src/commonMain/kotlin/org/openapitools/client/models/FormatTest.kt src/commonMain/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt src/commonMain/kotlin/org/openapitools/client/models/HealthCheckResult.kt -src/commonMain/kotlin/org/openapitools/client/models/InlineObject.kt -src/commonMain/kotlin/org/openapitools/client/models/InlineObject1.kt -src/commonMain/kotlin/org/openapitools/client/models/InlineObject2.kt -src/commonMain/kotlin/org/openapitools/client/models/InlineObject3.kt -src/commonMain/kotlin/org/openapitools/client/models/InlineObject4.kt -src/commonMain/kotlin/org/openapitools/client/models/InlineObject5.kt src/commonMain/kotlin/org/openapitools/client/models/InlineResponseDefault.kt src/commonMain/kotlin/org/openapitools/client/models/List.kt src/commonMain/kotlin/org/openapitools/client/models/MapTest.kt diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION b/samples/openapi3/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION index d99e7162d01f..3fa3b389a57d 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.0-SNAPSHOT \ No newline at end of file +5.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/README.md b/samples/openapi3/client/petstore/kotlin-multiplatform/README.md index aeb7c3ce7984..aa3323bbf71c 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/README.md +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/README.md @@ -92,12 +92,6 @@ Class | Method | HTTP request | Description - [org.openapitools.client.models.FormatTest](docs/FormatTest.md) - [org.openapitools.client.models.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - [org.openapitools.client.models.HealthCheckResult](docs/HealthCheckResult.md) - - [org.openapitools.client.models.InlineObject](docs/InlineObject.md) - - [org.openapitools.client.models.InlineObject1](docs/InlineObject1.md) - - [org.openapitools.client.models.InlineObject2](docs/InlineObject2.md) - - [org.openapitools.client.models.InlineObject3](docs/InlineObject3.md) - - [org.openapitools.client.models.InlineObject4](docs/InlineObject4.md) - - [org.openapitools.client.models.InlineObject5](docs/InlineObject5.md) - [org.openapitools.client.models.InlineResponseDefault](docs/InlineResponseDefault.md) - [org.openapitools.client.models.List](docs/List.md) - [org.openapitools.client.models.MapTest](docs/MapTest.md) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FakeApi.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FakeApi.md index 851d2f468215..b8dfefb771b7 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FakeApi.md @@ -551,13 +551,13 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **enumHeaderStringArray** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] - **enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to "-efg"] [enum: _abc, -efg, (xyz)] + **enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumQueryStringArray** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] - **enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to "-efg"] [enum: _abc, -efg, (xyz)] + **enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumQueryInteger** | **kotlin.Int**| Query parameter enum test (double) | [optional] [enum: 1, -2] **enumQueryDouble** | **kotlin.Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] - **enumFormStringArray** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to "$"] [enum: >, $] - **enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to "-efg"] [enum: _abc, -efg, (xyz)] + **enumFormStringArray** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to $] [enum: >, $] + **enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] ### Return type diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FormatTest.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FormatTest.md index 080b13c2d8eb..cfabf1976d61 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FormatTest.md +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FormatTest.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **int64** | **kotlin.Long** | | [optional] **float** | **kotlin.Float** | | [optional] **double** | **kotlin.Double** | | [optional] +**decimal** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] **string** | **kotlin.String** | | [optional] **binary** | [**org.openapitools.client.infrastructure.OctetByteArray**](org.openapitools.client.infrastructure.OctetByteArray.md) | | [optional] **dateTime** | **kotlin.String** | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/List.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/List.md index 13a09a4c4141..f426d541a409 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/List.md +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/List.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**`123minusList`** | **kotlin.String** | | [optional] +**`123list`** | **kotlin.String** | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/SpecialModelName.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/SpecialModelName.md index 282649449d96..b179e705ab05 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/SpecialModelName.md +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/SpecialModelName.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **kotlin.Long** | | [optional] +**dollarSpecialPropertyName** | **kotlin.Long** | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/FakeApi.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/FakeApi.kt index d98ccb9adb01..73a8ed48ed66 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/FakeApi.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/FakeApi.kt @@ -405,13 +405,13 @@ class FakeApi @UseExperimental(UnstableDefault::class) constructor( * To test enum parameters * To test enum parameters * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to "-efg") + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to "-efg") + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) * @param enumQueryInteger Query parameter enum test (double) (optional) * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to "$") - * @param enumFormString Form parameter enum test (string) (optional, default to "-efg") + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) * @return void */ suspend fun testEnumParameters(enumHeaderStringArray: kotlin.collections.List?, enumHeaderString: kotlin.String?, enumQueryStringArray: kotlin.collections.List?, enumQueryString: kotlin.String?, enumQueryInteger: kotlin.Int?, enumQueryDouble: kotlin.Double?, enumFormStringArray: kotlin.collections.List?, enumFormString: kotlin.String?): HttpResponse { diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index f866f94634f8..ed8e28588147 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -46,7 +46,6 @@ open class ApiClient( val clientConfig: (HttpClientConfig<*>) -> Unit = { it.install(JsonFeature, jsonConfig) } httpClientEngine?.let { HttpClient(it, clientConfig) } ?: HttpClient(clientConfig) } - private val authentications: kotlin.collections.Map by lazy { mapOf( "api_key" to ApiKeyAuth("header", "api_key"), @@ -98,12 +97,6 @@ open class ApiClient( serializer.setMapper(org.openapitools.client.models.FormatTest::class, org.openapitools.client.models.FormatTest.serializer()) serializer.setMapper(org.openapitools.client.models.HasOnlyReadOnly::class, org.openapitools.client.models.HasOnlyReadOnly.serializer()) serializer.setMapper(org.openapitools.client.models.HealthCheckResult::class, org.openapitools.client.models.HealthCheckResult.serializer()) - serializer.setMapper(org.openapitools.client.models.InlineObject::class, org.openapitools.client.models.InlineObject.serializer()) - serializer.setMapper(org.openapitools.client.models.InlineObject1::class, org.openapitools.client.models.InlineObject1.serializer()) - serializer.setMapper(org.openapitools.client.models.InlineObject2::class, org.openapitools.client.models.InlineObject2.serializer()) - serializer.setMapper(org.openapitools.client.models.InlineObject3::class, org.openapitools.client.models.InlineObject3.serializer()) - serializer.setMapper(org.openapitools.client.models.InlineObject4::class, org.openapitools.client.models.InlineObject4.serializer()) - serializer.setMapper(org.openapitools.client.models.InlineObject5::class, org.openapitools.client.models.InlineObject5.serializer()) serializer.setMapper(org.openapitools.client.models.InlineResponseDefault::class, org.openapitools.client.models.InlineResponseDefault.serializer()) serializer.setMapper(org.openapitools.client.models.List::class, org.openapitools.client.models.List.serializer()) serializer.setMapper(org.openapitools.client.models.MapTest::class, org.openapitools.client.models.MapTest.serializer()) @@ -133,7 +126,7 @@ open class ApiClient( * @param username Username */ fun setUsername(username: String) { - val auth = authentications.values.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? + val auth = authentications?.values?.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? ?: throw Exception("No HTTP basic authentication configured") auth.username = username } @@ -144,7 +137,7 @@ open class ApiClient( * @param password Password */ fun setPassword(password: String) { - val auth = authentications.values.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? + val auth = authentications?.values?.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? ?: throw Exception("No HTTP basic authentication configured") auth.password = password } @@ -156,7 +149,7 @@ open class ApiClient( * @param paramName The name of the API key parameter, or null or set the first key. */ fun setApiKey(apiKey: String, paramName: String? = null) { - val auth = authentications.values.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName)} as ApiKeyAuth? + val auth = authentications?.values?.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName)} as ApiKeyAuth? ?: throw Exception("No API key authentication configured") auth.apiKey = apiKey } @@ -168,7 +161,7 @@ open class ApiClient( * @param paramName The name of the API key parameter, or null or set the first key. */ fun setApiKeyPrefix(apiKeyPrefix: String, paramName: String? = null) { - val auth = authentications.values.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName) } as ApiKeyAuth? + val auth = authentications?.values?.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName) } as ApiKeyAuth? ?: throw Exception("No API key authentication configured") auth.apiKeyPrefix = apiKeyPrefix } @@ -179,7 +172,7 @@ open class ApiClient( * @param accessToken Access token */ fun setAccessToken(accessToken: String) { - val auth = authentications.values.firstOrNull { it is OAuth } as OAuth? + val auth = authentications?.values?.firstOrNull { it is OAuth } as OAuth? ?: throw Exception("No OAuth2 authentication configured") auth.accessToken = accessToken } @@ -190,7 +183,7 @@ open class ApiClient( * @param bearerToken The bearer token. */ fun setBearerToken(bearerToken: String) { - val auth = authentications.values.firstOrNull { it is HttpBearerAuth } as HttpBearerAuth? + val auth = authentications?.values?.firstOrNull { it is HttpBearerAuth } as HttpBearerAuth? ?: throw Exception("No Bearer authentication configured") auth.bearerToken = bearerToken } @@ -234,7 +227,7 @@ open class ApiClient( private fun RequestConfig.updateForAuth(authNames: kotlin.collections.List) { for (authName in authNames) { - val auth = authentications[authName] ?: throw Exception("Authentication undefined: $authName") + val auth = authentications?.get(authName) ?: throw Exception("Authentication undefined: $authName") auth.apply(query, headers) } } diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/FormatTest.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/FormatTest.kt index ed2e0e2eec2a..251ce3fe48d5 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/FormatTest.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/FormatTest.kt @@ -26,6 +26,7 @@ import kotlinx.serialization.internal.CommonEnumSerializer * @param int64 * @param float * @param double + * @param decimal * @param string * @param binary * @param dateTime @@ -44,6 +45,7 @@ data class FormatTest ( @SerialName(value = "int64") val int64: kotlin.Long? = null, @SerialName(value = "float") val float: kotlin.Float? = null, @SerialName(value = "double") val double: kotlin.Double? = null, + @SerialName(value = "decimal") val decimal: java.math.BigDecimal? = null, @SerialName(value = "string") val string: kotlin.String? = null, @SerialName(value = "binary") val binary: org.openapitools.client.infrastructure.OctetByteArray? = null, @SerialName(value = "dateTime") val dateTime: kotlin.String? = null, diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/List.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/List.kt index f68a4dc3a860..ea3ede2d5cb0 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/List.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/List.kt @@ -17,10 +17,10 @@ import kotlinx.serialization.internal.CommonEnumSerializer /** * - * @param `123minusList` + * @param `123list` */ @Serializable data class List ( - @SerialName(value = "123-list") val `123minusList`: kotlin.String? = null + @SerialName(value = "123-list") val `123list`: kotlin.String? = null ) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/SpecialModelname.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/SpecialModelname.kt index 7a8c1c83c8b8..e8a3ddd658f1 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/SpecialModelname.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/SpecialModelname.kt @@ -17,10 +17,10 @@ import kotlinx.serialization.internal.CommonEnumSerializer /** * - * @param dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket + * @param dollarSpecialPropertyName */ @Serializable data class SpecialModelname ( - @SerialName(value = "\$special[property.name]") val dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket: kotlin.Long? = null + @SerialName(value = "\$special[property.name]") val dollarSpecialPropertyName: kotlin.Long? = null ) diff --git a/samples/openapi3/client/petstore/kotlin/.openapi-generator/FILES b/samples/openapi3/client/petstore/kotlin/.openapi-generator/FILES index 535d2438cfdf..2deaf69a977c 100644 --- a/samples/openapi3/client/petstore/kotlin/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/kotlin/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.openapi-generator-ignore README.md build.gradle docs/200Response.md @@ -28,12 +27,6 @@ docs/Foo.md docs/FormatTest.md docs/HasOnlyReadOnly.md docs/HealthCheckResult.md -docs/InlineObject.md -docs/InlineObject1.md -docs/InlineObject2.md -docs/InlineObject3.md -docs/InlineObject4.md -docs/InlineObject5.md docs/InlineResponseDefault.md docs/List.md docs/MapTest.md @@ -100,12 +93,6 @@ src/main/kotlin/org/openapitools/client/models/Foo.kt src/main/kotlin/org/openapitools/client/models/FormatTest.kt src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt -src/main/kotlin/org/openapitools/client/models/InlineObject.kt -src/main/kotlin/org/openapitools/client/models/InlineObject1.kt -src/main/kotlin/org/openapitools/client/models/InlineObject2.kt -src/main/kotlin/org/openapitools/client/models/InlineObject3.kt -src/main/kotlin/org/openapitools/client/models/InlineObject4.kt -src/main/kotlin/org/openapitools/client/models/InlineObject5.kt src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt src/main/kotlin/org/openapitools/client/models/List.kt src/main/kotlin/org/openapitools/client/models/MapTest.kt diff --git a/samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION b/samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION index d99e7162d01f..3fa3b389a57d 100644 --- a/samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.0-SNAPSHOT \ No newline at end of file +5.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin/README.md b/samples/openapi3/client/petstore/kotlin/README.md index 0039d13c3568..76aa2b6cd520 100644 --- a/samples/openapi3/client/petstore/kotlin/README.md +++ b/samples/openapi3/client/petstore/kotlin/README.md @@ -101,12 +101,6 @@ Class | Method | HTTP request | Description - [org.openapitools.client.models.FormatTest](docs/FormatTest.md) - [org.openapitools.client.models.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - [org.openapitools.client.models.HealthCheckResult](docs/HealthCheckResult.md) - - [org.openapitools.client.models.InlineObject](docs/InlineObject.md) - - [org.openapitools.client.models.InlineObject1](docs/InlineObject1.md) - - [org.openapitools.client.models.InlineObject2](docs/InlineObject2.md) - - [org.openapitools.client.models.InlineObject3](docs/InlineObject3.md) - - [org.openapitools.client.models.InlineObject4](docs/InlineObject4.md) - - [org.openapitools.client.models.InlineObject5](docs/InlineObject5.md) - [org.openapitools.client.models.InlineResponseDefault](docs/InlineResponseDefault.md) - [org.openapitools.client.models.List](docs/List.md) - [org.openapitools.client.models.MapTest](docs/MapTest.md) diff --git a/samples/openapi3/client/petstore/kotlin/build.gradle b/samples/openapi3/client/petstore/kotlin/build.gradle index 9d6960b77a15..56be0bd0dd87 100644 --- a/samples/openapi3/client/petstore/kotlin/build.gradle +++ b/samples/openapi3/client/petstore/kotlin/build.gradle @@ -29,11 +29,9 @@ test { dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.0" compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" compile "com.squareup.moshi:moshi-kotlin:1.9.2" compile "com.squareup.moshi:moshi-adapters:1.9.2" compile "com.squareup.okhttp3:okhttp:4.2.2" - compile "com.squareup.okhttp3:logging-interceptor:4.4.0" testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0" } diff --git a/samples/openapi3/client/petstore/kotlin/docs/FakeApi.md b/samples/openapi3/client/petstore/kotlin/docs/FakeApi.md index 40ca579b51b4..e5aef0b8b6d7 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/kotlin/docs/FakeApi.md @@ -551,13 +551,13 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **enumHeaderStringArray** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] - **enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to "-efg"] [enum: _abc, -efg, (xyz)] + **enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumQueryStringArray** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] - **enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to "-efg"] [enum: _abc, -efg, (xyz)] + **enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] **enumQueryInteger** | **kotlin.Int**| Query parameter enum test (double) | [optional] [enum: 1, -2] **enumQueryDouble** | **kotlin.Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] - **enumFormStringArray** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to "$"] [enum: >, $] - **enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to "-efg"] [enum: _abc, -efg, (xyz)] + **enumFormStringArray** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to $] [enum: >, $] + **enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] ### Return type diff --git a/samples/openapi3/client/petstore/kotlin/docs/FormatTest.md b/samples/openapi3/client/petstore/kotlin/docs/FormatTest.md index 0357923c97a5..01b408499e73 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/FormatTest.md +++ b/samples/openapi3/client/petstore/kotlin/docs/FormatTest.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **int64** | **kotlin.Long** | | [optional] **float** | **kotlin.Float** | | [optional] **double** | **kotlin.Double** | | [optional] +**decimal** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] **string** | **kotlin.String** | | [optional] **binary** | [**java.io.File**](java.io.File.md) | | [optional] **dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin/docs/List.md b/samples/openapi3/client/petstore/kotlin/docs/List.md index 13a09a4c4141..f426d541a409 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/List.md +++ b/samples/openapi3/client/petstore/kotlin/docs/List.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**`123minusList`** | **kotlin.String** | | [optional] +**`123list`** | **kotlin.String** | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin/docs/SpecialModelName.md b/samples/openapi3/client/petstore/kotlin/docs/SpecialModelName.md index 282649449d96..b179e705ab05 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/SpecialModelName.md +++ b/samples/openapi3/client/petstore/kotlin/docs/SpecialModelName.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **kotlin.Long** | | [optional] +**dollarSpecialPropertyName** | **kotlin.Long** | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt index 647272f7e2b2..085f742fe203 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt @@ -98,7 +98,8 @@ class FakeApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("query_1", listOf(query1.toString())) } } - val localVariableHeaders: MutableMap = mutableMapOf("header_1" to header1.toString()) + val localVariableHeaders: MutableMap = mutableMapOf() + header1?.apply { localVariableHeaders["header_1"] = this.toString() } val localVariableConfig = RequestConfig( RequestMethod.GET, "/fake/http-signature-test", @@ -471,13 +472,13 @@ class FakeApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * To test enum parameters * To test enum parameters * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to "-efg") + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to "-efg") + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) * @param enumQueryInteger Query parameter enum test (double) (optional) * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to "$") - * @param enumFormString Form parameter enum test (string) (optional, default to "-efg") + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) * @return void * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response @@ -501,7 +502,9 @@ class FakeApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("enum_query_double", listOf(enumQueryDouble.toString())) } } - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded", "enum_header_string_array" to enumHeaderStringArray.joinToString(separator = collectionDelimiter("csv")), "enum_header_string" to enumHeaderString.toString()) + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") + enumHeaderStringArray?.apply { localVariableHeaders["enum_header_string_array"] = this.joinToString(separator = collectionDelimiter("csv")) } + enumHeaderString?.apply { localVariableHeaders["enum_header_string"] = this.toString() } val localVariableConfig = RequestConfig( RequestMethod.GET, "/fake", @@ -556,7 +559,9 @@ class FakeApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("int64_group", listOf(int64Group.toString())) } } - val localVariableHeaders: MutableMap = mutableMapOf("required_boolean_group" to requiredBooleanGroup.toString(), "boolean_group" to booleanGroup.toString()) + val localVariableHeaders: MutableMap = mutableMapOf() + requiredBooleanGroup?.apply { localVariableHeaders["required_boolean_group"] = this.toString() } + booleanGroup?.apply { localVariableHeaders["boolean_group"] = this.toString() } val localVariableConfig = RequestConfig( RequestMethod.DELETE, "/fake", diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 8dd12cf26ab5..d0295348e3fd 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -88,7 +88,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { 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 localVariableHeaders: MutableMap = mutableMapOf() + apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } val localVariableConfig = RequestConfig( RequestMethod.DELETE, "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt index 69b562becb07..9bd2790dc144 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt @@ -10,6 +10,7 @@ val Response.isInformational : Boolean get() = this.code in 100..199 /** * Provides an extension to evaluation whether the response is a 3xx code */ +@Suppress("EXTENSION_SHADOWED_BY_MEMBER") val Response.isRedirect : Boolean get() = this.code in 300..399 /** diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index 697559b2ec16..9a45b67d9b1a 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -1,14 +1,12 @@ package org.openapitools.client.infrastructure import com.squareup.moshi.Moshi -import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory import java.util.Date object Serializer { @JvmStatic val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) .add(OffsetDateTimeAdapter()) .add(LocalDateTimeAdapter()) .add(LocalDateAdapter()) diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt index 5a1fec435b1b..d0bbef4836c9 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt @@ -26,6 +26,7 @@ import java.io.Serializable * @param int64 * @param float * @param double + * @param decimal * @param string * @param binary * @param dateTime @@ -53,6 +54,8 @@ data class FormatTest ( val float: kotlin.Float? = null, @Json(name = "double") val double: kotlin.Double? = null, + @Json(name = "decimal") + val decimal: java.math.BigDecimal? = null, @Json(name = "string") val string: kotlin.String? = null, @Json(name = "binary") diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt index f16cdddc8c7d..bb3f49c6984e 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt @@ -17,12 +17,12 @@ import java.io.Serializable /** * - * @param `123minusList` + * @param `123list` */ data class List ( @Json(name = "123-list") - val `123minusList`: kotlin.String? = null + val `123list`: kotlin.String? = null ) : Serializable { companion object { private const val serialVersionUID: Long = 123 diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt index c51eefb1ce41..a315761a8f8f 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt @@ -17,12 +17,12 @@ import java.io.Serializable /** * - * @param dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket + * @param dollarSpecialPropertyName */ data class SpecialModelname ( @Json(name = "\$special[property.name]") - val dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket: kotlin.Long? = null + val dollarSpecialPropertyName: kotlin.Long? = null ) : Serializable { companion object { private const val serialVersionUID: Long = 123 diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/.openapi-generator/FILES b/samples/openapi3/server/petstore/kotlin-springboot-reactive/.openapi-generator/FILES index 07fb739ffae5..e48401e8ff47 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/.openapi-generator/FILES +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/.openapi-generator/FILES @@ -14,8 +14,6 @@ src/main/kotlin/org/openapitools/api/UserApi.kt src/main/kotlin/org/openapitools/api/UserApiService.kt src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt src/main/kotlin/org/openapitools/model/Category.kt -src/main/kotlin/org/openapitools/model/InlineObject.kt -src/main/kotlin/org/openapitools/model/InlineObject1.kt src/main/kotlin/org/openapitools/model/ModelApiResponse.kt src/main/kotlin/org/openapitools/model/Order.kt src/main/kotlin/org/openapitools/model/Pet.kt diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION b/samples/openapi3/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION index d99e7162d01f..3fa3b389a57d 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.0-SNAPSHOT \ No newline at end of file +5.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApi.kt index b77d4eaed655..7f02e0938ab6 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -13,14 +13,7 @@ import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity -import org.springframework.web.bind.annotation.RequestBody -import org.springframework.web.bind.annotation.RequestPart -import org.springframework.web.bind.annotation.RequestParam -import org.springframework.web.bind.annotation.PathVariable -import org.springframework.web.bind.annotation.RequestHeader -import org.springframework.web.bind.annotation.RequestMethod -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController +import org.springframework.web.bind.annotation.* import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired @@ -52,11 +45,11 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 405, message = "Invalid input")]) - @RequestMapping( + @PostMapping( value = ["/pet"], - produces = ["application/xml", "application/json"], - consumes = ["application/json", "application/xml"], - method = [RequestMethod.POST]) + produces = ["application/xml", "application/json"], + consumes = ["application/json", "application/xml"] + ) suspend fun addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody pet: Pet ): ResponseEntity { return ResponseEntity(service.addPet(pet), HttpStatus.valueOf(200)) @@ -69,9 +62,9 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid pet value")]) - @RequestMapping( - value = ["/pet/{petId}"], - method = [RequestMethod.DELETE]) + @DeleteMapping( + value = ["/pet/{petId}"] + ) suspend fun deletePet(@ApiParam(value = "Pet id to delete", required=true) @PathVariable("petId") petId: kotlin.Long ,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) apiKey: kotlin.String? ): ResponseEntity { @@ -87,10 +80,10 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid status value")]) - @RequestMapping( + @GetMapping( value = ["/pet/findByStatus"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + produces = ["application/xml", "application/json"] + ) fun findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List ): ResponseEntity> { return ResponseEntity(service.findPetsByStatus(status), HttpStatus.valueOf(200)) @@ -105,10 +98,10 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid tag value")]) - @RequestMapping( + @GetMapping( value = ["/pet/findByTags"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + produces = ["application/xml", "application/json"] + ) fun findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List ): ResponseEntity> { return ResponseEntity(service.findPetsByTags(tags), HttpStatus.valueOf(200)) @@ -122,10 +115,10 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found")]) - @RequestMapping( + @GetMapping( value = ["/pet/{petId}"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + produces = ["application/xml", "application/json"] + ) suspend fun getPetById(@ApiParam(value = "ID of pet to return", required=true) @PathVariable("petId") petId: kotlin.Long ): ResponseEntity { return ResponseEntity(service.getPetById(petId), HttpStatus.valueOf(200)) @@ -139,11 +132,11 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found"),ApiResponse(code = 405, message = "Validation exception")]) - @RequestMapping( + @PutMapping( value = ["/pet"], - produces = ["application/xml", "application/json"], - consumes = ["application/json", "application/xml"], - method = [RequestMethod.PUT]) + produces = ["application/xml", "application/json"], + consumes = ["application/json", "application/xml"] + ) suspend fun updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody pet: Pet ): ResponseEntity { return ResponseEntity(service.updatePet(pet), HttpStatus.valueOf(200)) @@ -156,10 +149,10 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 405, message = "Invalid input")]) - @RequestMapping( + @PostMapping( value = ["/pet/{petId}"], - consumes = ["application/x-www-form-urlencoded"], - method = [RequestMethod.POST]) + consumes = ["application/x-www-form-urlencoded"] + ) suspend fun updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required=true) @PathVariable("petId") petId: kotlin.Long ,@ApiParam(value = "Updated name of the pet") @RequestParam(value="name", required=false) name: kotlin.String? ,@ApiParam(value = "Updated status of the pet") @RequestParam(value="status", required=false) status: kotlin.String? @@ -175,11 +168,11 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse::class)]) - @RequestMapping( + @PostMapping( value = ["/pet/{petId}/uploadImage"], - produces = ["application/json"], - consumes = ["multipart/form-data"], - method = [RequestMethod.POST]) + produces = ["application/json"], + consumes = ["multipart/form-data"] + ) suspend fun uploadFile(@ApiParam(value = "ID of pet to update", required=true) @PathVariable("petId") petId: kotlin.Long ,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) additionalMetadata: kotlin.String? ,@ApiParam(value = "file detail") @Valid @RequestPart("file") file: org.springframework.core.io.Resource? diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApi.kt index 528129abc42c..acfb3f62ae03 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -12,14 +12,7 @@ import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity -import org.springframework.web.bind.annotation.RequestBody -import org.springframework.web.bind.annotation.RequestPart -import org.springframework.web.bind.annotation.RequestParam -import org.springframework.web.bind.annotation.PathVariable -import org.springframework.web.bind.annotation.RequestHeader -import org.springframework.web.bind.annotation.RequestMethod -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController +import org.springframework.web.bind.annotation.* import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired @@ -49,9 +42,9 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors") @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) - @RequestMapping( - value = ["/store/order/{orderId}"], - method = [RequestMethod.DELETE]) + @DeleteMapping( + value = ["/store/order/{orderId}"] + ) suspend fun deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required=true) @PathVariable("orderId") orderId: kotlin.String ): ResponseEntity { return ResponseEntity(service.deleteOrder(orderId), HttpStatus.valueOf(400)) @@ -66,10 +59,10 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.collections.Map::class, responseContainer = "Map")]) - @RequestMapping( + @GetMapping( value = ["/store/inventory"], - produces = ["application/json"], - method = [RequestMethod.GET]) + produces = ["application/json"] + ) suspend fun getInventory(): ResponseEntity> { return ResponseEntity(service.getInventory(), HttpStatus.valueOf(200)) } @@ -81,10 +74,10 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic response = Order::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) - @RequestMapping( + @GetMapping( value = ["/store/order/{orderId}"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + produces = ["application/xml", "application/json"] + ) suspend fun getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required=true) @PathVariable("orderId") orderId: kotlin.Long ): ResponseEntity { return ResponseEntity(service.getOrderById(orderId), HttpStatus.valueOf(200)) @@ -97,11 +90,11 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic response = Order::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid Order")]) - @RequestMapping( + @PostMapping( value = ["/store/order"], - produces = ["application/xml", "application/json"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + produces = ["application/xml", "application/json"], + consumes = ["application/json"] + ) suspend fun placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody order: Order ): ResponseEntity { return ResponseEntity(service.placeOrder(order), HttpStatus.valueOf(200)) diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApi.kt index 479219327adc..ca309c95e915 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -12,14 +12,7 @@ import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity -import org.springframework.web.bind.annotation.RequestBody -import org.springframework.web.bind.annotation.RequestPart -import org.springframework.web.bind.annotation.RequestParam -import org.springframework.web.bind.annotation.PathVariable -import org.springframework.web.bind.annotation.RequestHeader -import org.springframework.web.bind.annotation.RequestMethod -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController +import org.springframework.web.bind.annotation.* import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired @@ -50,10 +43,10 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @RequestMapping( + @PostMapping( value = ["/user"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + consumes = ["application/json"] + ) suspend fun createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody user: User ): ResponseEntity { return ResponseEntity(service.createUser(user), HttpStatus.valueOf(200)) @@ -66,10 +59,10 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @RequestMapping( + @PostMapping( value = ["/user/createWithArray"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + consumes = ["application/json"] + ) suspend fun createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody user: Flow ): ResponseEntity { return ResponseEntity(service.createUsersWithArrayInput(user), HttpStatus.valueOf(200)) @@ -82,10 +75,10 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @RequestMapping( + @PostMapping( value = ["/user/createWithList"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + consumes = ["application/json"] + ) suspend fun createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody user: Flow ): ResponseEntity { return ResponseEntity(service.createUsersWithListInput(user), HttpStatus.valueOf(200)) @@ -98,9 +91,9 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) - @RequestMapping( - value = ["/user/{username}"], - method = [RequestMethod.DELETE]) + @DeleteMapping( + value = ["/user/{username}"] + ) suspend fun deleteUser(@ApiParam(value = "The name that needs to be deleted", required=true) @PathVariable("username") username: kotlin.String ): ResponseEntity { return ResponseEntity(service.deleteUser(username), HttpStatus.valueOf(400)) @@ -113,10 +106,10 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) response = User::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = User::class),ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) - @RequestMapping( + @GetMapping( value = ["/user/{username}"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + produces = ["application/xml", "application/json"] + ) suspend fun getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") username: kotlin.String ): ResponseEntity { return ResponseEntity(service.getUserByName(username), HttpStatus.valueOf(200)) @@ -129,10 +122,10 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) response = kotlin.String::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.String::class),ApiResponse(code = 400, message = "Invalid username/password supplied")]) - @RequestMapping( + @GetMapping( value = ["/user/login"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + produces = ["application/xml", "application/json"] + ) suspend fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String ,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String ): ResponseEntity { @@ -146,9 +139,9 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @RequestMapping( - value = ["/user/logout"], - method = [RequestMethod.GET]) + @GetMapping( + value = ["/user/logout"] + ) suspend fun logoutUser(): ResponseEntity { return ResponseEntity(service.logoutUser(), HttpStatus.valueOf(200)) } @@ -160,10 +153,10 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid user supplied"),ApiResponse(code = 404, message = "User not found")]) - @RequestMapping( + @PutMapping( value = ["/user/{username}"], - consumes = ["application/json"], - method = [RequestMethod.PUT]) + consumes = ["application/json"] + ) suspend fun updateUser(@ApiParam(value = "name that need to be deleted", required=true) @PathVariable("username") username: kotlin.String ,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody user: User ): ResponseEntity { diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt index c62a3ec6c6eb..42348e7084aa 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt @@ -9,6 +9,7 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size +import javax.validation.Valid import io.swagger.annotations.ApiModelProperty /** @@ -20,7 +21,7 @@ data class Category( @ApiModelProperty(example = "null", value = "") @field:JsonProperty("id") val id: kotlin.Long? = null, -@get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") + @get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiModelProperty(example = "null", value = "") @field:JsonProperty("name") val name: kotlin.String? = null ) { diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 6ac03ab610eb..6ada956e84e4 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -9,6 +9,7 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size +import javax.validation.Valid import io.swagger.annotations.ApiModelProperty /** diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt index 83f4ba454214..2de2fa35642b 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt @@ -10,6 +10,7 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size +import javax.validation.Valid import io.swagger.annotations.ApiModelProperty /** @@ -39,7 +40,7 @@ data class Order( @field:JsonProperty("status") val status: Order.Status? = null, @ApiModelProperty(example = "null", value = "") - @field:JsonProperty("complete") val complete: kotlin.Boolean? = null + @field:JsonProperty("complete") val complete: kotlin.Boolean? = false ) { /** diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt index de74ce560543..22bbe695c0dc 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt @@ -12,6 +12,7 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size +import javax.validation.Valid import io.swagger.annotations.ApiModelProperty /** @@ -25,20 +26,20 @@ import io.swagger.annotations.ApiModelProperty */ data class Pet( - @get:NotNull @ApiModelProperty(example = "doggie", required = true, value = "") - @field:JsonProperty("name") val name: kotlin.String, + @field:JsonProperty("name", required = true) val name: kotlin.String, - @get:NotNull @ApiModelProperty(example = "null", required = true, value = "") - @field:JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, + @field:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, @ApiModelProperty(example = "null", value = "") @field:JsonProperty("id") val id: kotlin.Long? = null, + @field:Valid @ApiModelProperty(example = "null", value = "") @field:JsonProperty("category") val category: Category? = null, + @field:Valid @ApiModelProperty(example = "null", value = "") @field:JsonProperty("tags") val tags: kotlin.collections.List? = null, diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt index 7e7d12349842..ab8e83484980 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt @@ -9,6 +9,7 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size +import javax.validation.Valid import io.swagger.annotations.ApiModelProperty /** diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt index dc58873346e6..c083bd85dba8 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt @@ -9,6 +9,7 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size +import javax.validation.Valid import io.swagger.annotations.ApiModelProperty /** diff --git a/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/FILES b/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/FILES index 7a4e308c40d2..612ea14bbdb4 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/FILES +++ b/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/FILES @@ -15,8 +15,6 @@ src/main/kotlin/org/openapitools/api/UserApi.kt src/main/kotlin/org/openapitools/api/UserApiService.kt src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt src/main/kotlin/org/openapitools/model/Category.kt -src/main/kotlin/org/openapitools/model/InlineObject.kt -src/main/kotlin/org/openapitools/model/InlineObject1.kt src/main/kotlin/org/openapitools/model/ModelApiResponse.kt src/main/kotlin/org/openapitools/model/Order.kt src/main/kotlin/org/openapitools/model/Pet.kt diff --git a/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION b/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION index d99e7162d01f..3fa3b389a57d 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION +++ b/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.0-SNAPSHOT \ No newline at end of file +5.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt index 5b5ec9b8faeb..a2d6231bcb2e 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -13,14 +13,7 @@ import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity -import org.springframework.web.bind.annotation.RequestBody -import org.springframework.web.bind.annotation.RequestPart -import org.springframework.web.bind.annotation.RequestParam -import org.springframework.web.bind.annotation.PathVariable -import org.springframework.web.bind.annotation.RequestHeader -import org.springframework.web.bind.annotation.RequestMethod -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController +import org.springframework.web.bind.annotation.* import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired @@ -51,11 +44,11 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 405, message = "Invalid input")]) - @RequestMapping( + @PostMapping( value = ["/pet"], - produces = ["application/xml", "application/json"], - consumes = ["application/json", "application/xml"], - method = [RequestMethod.POST]) + produces = ["application/xml", "application/json"], + consumes = ["application/json", "application/xml"] + ) fun addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody pet: Pet ): ResponseEntity { return ResponseEntity(service.addPet(pet), HttpStatus.valueOf(200)) @@ -68,9 +61,9 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid pet value")]) - @RequestMapping( - value = ["/pet/{petId}"], - method = [RequestMethod.DELETE]) + @DeleteMapping( + value = ["/pet/{petId}"] + ) fun deletePet(@ApiParam(value = "Pet id to delete", required=true) @PathVariable("petId") petId: kotlin.Long ,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) apiKey: kotlin.String? ): ResponseEntity { @@ -86,10 +79,10 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid status value")]) - @RequestMapping( + @GetMapping( value = ["/pet/findByStatus"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + produces = ["application/xml", "application/json"] + ) fun findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List ): ResponseEntity> { return ResponseEntity(service.findPetsByStatus(status), HttpStatus.valueOf(200)) @@ -104,10 +97,10 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid tag value")]) - @RequestMapping( + @GetMapping( value = ["/pet/findByTags"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + produces = ["application/xml", "application/json"] + ) fun findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List ): ResponseEntity> { return ResponseEntity(service.findPetsByTags(tags), HttpStatus.valueOf(200)) @@ -121,10 +114,10 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found")]) - @RequestMapping( + @GetMapping( value = ["/pet/{petId}"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + produces = ["application/xml", "application/json"] + ) fun getPetById(@ApiParam(value = "ID of pet to return", required=true) @PathVariable("petId") petId: kotlin.Long ): ResponseEntity { return ResponseEntity(service.getPetById(petId), HttpStatus.valueOf(200)) @@ -138,11 +131,11 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found"),ApiResponse(code = 405, message = "Validation exception")]) - @RequestMapping( + @PutMapping( value = ["/pet"], - produces = ["application/xml", "application/json"], - consumes = ["application/json", "application/xml"], - method = [RequestMethod.PUT]) + produces = ["application/xml", "application/json"], + consumes = ["application/json", "application/xml"] + ) fun updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody pet: Pet ): ResponseEntity { return ResponseEntity(service.updatePet(pet), HttpStatus.valueOf(200)) @@ -155,10 +148,10 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 405, message = "Invalid input")]) - @RequestMapping( + @PostMapping( value = ["/pet/{petId}"], - consumes = ["application/x-www-form-urlencoded"], - method = [RequestMethod.POST]) + consumes = ["application/x-www-form-urlencoded"] + ) fun updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required=true) @PathVariable("petId") petId: kotlin.Long ,@ApiParam(value = "Updated name of the pet") @RequestParam(value="name", required=false) name: kotlin.String? ,@ApiParam(value = "Updated status of the pet") @RequestParam(value="status", required=false) status: kotlin.String? @@ -174,11 +167,11 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse::class)]) - @RequestMapping( + @PostMapping( value = ["/pet/{petId}/uploadImage"], - produces = ["application/json"], - consumes = ["multipart/form-data"], - method = [RequestMethod.POST]) + produces = ["application/json"], + consumes = ["multipart/form-data"] + ) fun uploadFile(@ApiParam(value = "ID of pet to update", required=true) @PathVariable("petId") petId: kotlin.Long ,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) additionalMetadata: kotlin.String? ,@ApiParam(value = "file detail") @Valid @RequestPart("file") file: org.springframework.core.io.Resource? diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt index 1e9e28c7b9db..9199ce4e307b 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -12,14 +12,7 @@ import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity -import org.springframework.web.bind.annotation.RequestBody -import org.springframework.web.bind.annotation.RequestPart -import org.springframework.web.bind.annotation.RequestParam -import org.springframework.web.bind.annotation.PathVariable -import org.springframework.web.bind.annotation.RequestHeader -import org.springframework.web.bind.annotation.RequestMethod -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController +import org.springframework.web.bind.annotation.* import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired @@ -48,9 +41,9 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors") @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) - @RequestMapping( - value = ["/store/order/{orderId}"], - method = [RequestMethod.DELETE]) + @DeleteMapping( + value = ["/store/order/{orderId}"] + ) fun deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required=true) @PathVariable("orderId") orderId: kotlin.String ): ResponseEntity { return ResponseEntity(service.deleteOrder(orderId), HttpStatus.valueOf(400)) @@ -65,10 +58,10 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.collections.Map::class, responseContainer = "Map")]) - @RequestMapping( + @GetMapping( value = ["/store/inventory"], - produces = ["application/json"], - method = [RequestMethod.GET]) + produces = ["application/json"] + ) fun getInventory(): ResponseEntity> { return ResponseEntity(service.getInventory(), HttpStatus.valueOf(200)) } @@ -80,10 +73,10 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic response = Order::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) - @RequestMapping( + @GetMapping( value = ["/store/order/{orderId}"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + produces = ["application/xml", "application/json"] + ) fun getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required=true) @PathVariable("orderId") orderId: kotlin.Long ): ResponseEntity { return ResponseEntity(service.getOrderById(orderId), HttpStatus.valueOf(200)) @@ -96,11 +89,11 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic response = Order::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid Order")]) - @RequestMapping( + @PostMapping( value = ["/store/order"], - produces = ["application/xml", "application/json"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + produces = ["application/xml", "application/json"], + consumes = ["application/json"] + ) fun placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody order: Order ): ResponseEntity { return ResponseEntity(service.placeOrder(order), HttpStatus.valueOf(200)) diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt index 7a04f660f17f..8fe16331f827 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -12,14 +12,7 @@ import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity -import org.springframework.web.bind.annotation.RequestBody -import org.springframework.web.bind.annotation.RequestPart -import org.springframework.web.bind.annotation.RequestParam -import org.springframework.web.bind.annotation.PathVariable -import org.springframework.web.bind.annotation.RequestHeader -import org.springframework.web.bind.annotation.RequestMethod -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController +import org.springframework.web.bind.annotation.* import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired @@ -49,10 +42,10 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @RequestMapping( + @PostMapping( value = ["/user"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + consumes = ["application/json"] + ) fun createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody user: User ): ResponseEntity { return ResponseEntity(service.createUser(user), HttpStatus.valueOf(200)) @@ -65,10 +58,10 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @RequestMapping( + @PostMapping( value = ["/user/createWithArray"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + consumes = ["application/json"] + ) fun createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody user: kotlin.collections.List ): ResponseEntity { return ResponseEntity(service.createUsersWithArrayInput(user), HttpStatus.valueOf(200)) @@ -81,10 +74,10 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @RequestMapping( + @PostMapping( value = ["/user/createWithList"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + consumes = ["application/json"] + ) fun createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody user: kotlin.collections.List ): ResponseEntity { return ResponseEntity(service.createUsersWithListInput(user), HttpStatus.valueOf(200)) @@ -97,9 +90,9 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) - @RequestMapping( - value = ["/user/{username}"], - method = [RequestMethod.DELETE]) + @DeleteMapping( + value = ["/user/{username}"] + ) fun deleteUser(@ApiParam(value = "The name that needs to be deleted", required=true) @PathVariable("username") username: kotlin.String ): ResponseEntity { return ResponseEntity(service.deleteUser(username), HttpStatus.valueOf(400)) @@ -112,10 +105,10 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) response = User::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = User::class),ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) - @RequestMapping( + @GetMapping( value = ["/user/{username}"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + produces = ["application/xml", "application/json"] + ) fun getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") username: kotlin.String ): ResponseEntity { return ResponseEntity(service.getUserByName(username), HttpStatus.valueOf(200)) @@ -128,10 +121,10 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) response = kotlin.String::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.String::class),ApiResponse(code = 400, message = "Invalid username/password supplied")]) - @RequestMapping( + @GetMapping( value = ["/user/login"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + produces = ["application/xml", "application/json"] + ) fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String ,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String ): ResponseEntity { @@ -145,9 +138,9 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @RequestMapping( - value = ["/user/logout"], - method = [RequestMethod.GET]) + @GetMapping( + value = ["/user/logout"] + ) fun logoutUser(): ResponseEntity { return ResponseEntity(service.logoutUser(), HttpStatus.valueOf(200)) } @@ -159,10 +152,10 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid user supplied"),ApiResponse(code = 404, message = "User not found")]) - @RequestMapping( + @PutMapping( value = ["/user/{username}"], - consumes = ["application/json"], - method = [RequestMethod.PUT]) + consumes = ["application/json"] + ) fun updateUser(@ApiParam(value = "name that need to be deleted", required=true) @PathVariable("username") username: kotlin.String ,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody user: User ): ResponseEntity { diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt index c62a3ec6c6eb..42348e7084aa 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt @@ -9,6 +9,7 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size +import javax.validation.Valid import io.swagger.annotations.ApiModelProperty /** @@ -20,7 +21,7 @@ data class Category( @ApiModelProperty(example = "null", value = "") @field:JsonProperty("id") val id: kotlin.Long? = null, -@get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") + @get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiModelProperty(example = "null", value = "") @field:JsonProperty("name") val name: kotlin.String? = null ) { diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 6ac03ab610eb..6ada956e84e4 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -9,6 +9,7 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size +import javax.validation.Valid import io.swagger.annotations.ApiModelProperty /** diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt index 83f4ba454214..2de2fa35642b 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt @@ -10,6 +10,7 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size +import javax.validation.Valid import io.swagger.annotations.ApiModelProperty /** @@ -39,7 +40,7 @@ data class Order( @field:JsonProperty("status") val status: Order.Status? = null, @ApiModelProperty(example = "null", value = "") - @field:JsonProperty("complete") val complete: kotlin.Boolean? = null + @field:JsonProperty("complete") val complete: kotlin.Boolean? = false ) { /** diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt index de74ce560543..22bbe695c0dc 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt @@ -12,6 +12,7 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size +import javax.validation.Valid import io.swagger.annotations.ApiModelProperty /** @@ -25,20 +26,20 @@ import io.swagger.annotations.ApiModelProperty */ data class Pet( - @get:NotNull @ApiModelProperty(example = "doggie", required = true, value = "") - @field:JsonProperty("name") val name: kotlin.String, + @field:JsonProperty("name", required = true) val name: kotlin.String, - @get:NotNull @ApiModelProperty(example = "null", required = true, value = "") - @field:JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, + @field:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List, @ApiModelProperty(example = "null", value = "") @field:JsonProperty("id") val id: kotlin.Long? = null, + @field:Valid @ApiModelProperty(example = "null", value = "") @field:JsonProperty("category") val category: Category? = null, + @field:Valid @ApiModelProperty(example = "null", value = "") @field:JsonProperty("tags") val tags: kotlin.collections.List? = null, diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt index 7e7d12349842..ab8e83484980 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt @@ -9,6 +9,7 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size +import javax.validation.Valid import io.swagger.annotations.ApiModelProperty /** diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt index dc58873346e6..c083bd85dba8 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt @@ -9,6 +9,7 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size +import javax.validation.Valid import io.swagger.annotations.ApiModelProperty /** diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Order.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Order.kt index dc79ef79e703..dd392773e96a 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Order.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Order.kt @@ -26,7 +26,7 @@ data class Order ( val id: kotlin.Long? = null, val petId: kotlin.Long? = null, val quantity: kotlin.Int? = null, - val shipDate: java.time.LocalDateTime? = null, + val shipDate: java.time.OffsetDateTime? = null, /* Order Status */ val status: Order.Status? = null, val complete: kotlin.Boolean? = null diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION index d99e7162d01f..3fa3b389a57d 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.0-SNAPSHOT \ No newline at end of file +5.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApi.kt index b500f9155686..9de503175ac7 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -13,14 +13,7 @@ import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity -import org.springframework.web.bind.annotation.RequestBody -import org.springframework.web.bind.annotation.RequestPart -import org.springframework.web.bind.annotation.RequestParam -import org.springframework.web.bind.annotation.PathVariable -import org.springframework.web.bind.annotation.RequestHeader -import org.springframework.web.bind.annotation.RequestMethod -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController +import org.springframework.web.bind.annotation.* import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired @@ -39,7 +32,7 @@ import kotlin.collections.Map @RestController @Validated -@Api(value = "Pet", description = "The Pet API") +@Api(value = "pet", description = "The pet API") @RequestMapping("\${api.base-path:/v2}") class PetApiController(@Autowired(required = true) val service: PetApiService) { @@ -50,10 +43,10 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 405, message = "Invalid input")]) - @RequestMapping( + @PostMapping( value = ["/pet"], - consumes = ["application/json", "application/xml"], - method = [RequestMethod.POST]) + consumes = ["application/json", "application/xml"] + ) fun addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody body: Pet ): ResponseEntity { return ResponseEntity(service.addPet(body), HttpStatus.valueOf(405)) @@ -66,9 +59,9 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid pet value")]) - @RequestMapping( - value = ["/pet/{petId}"], - method = [RequestMethod.DELETE]) + @DeleteMapping( + value = ["/pet/{petId}"] + ) fun deletePet(@ApiParam(value = "Pet id to delete", required=true) @PathVariable("petId") petId: kotlin.Long ,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) apiKey: kotlin.String? ): ResponseEntity { @@ -84,10 +77,10 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid status value")]) - @RequestMapping( + @GetMapping( value = ["/pet/findByStatus"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + produces = ["application/xml", "application/json"] + ) fun findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List ): ResponseEntity> { return ResponseEntity(service.findPetsByStatus(status), HttpStatus.valueOf(200)) @@ -102,10 +95,10 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid tag value")]) - @RequestMapping( + @GetMapping( value = ["/pet/findByTags"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + produces = ["application/xml", "application/json"] + ) fun findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List ): ResponseEntity> { return ResponseEntity(service.findPetsByTags(tags), HttpStatus.valueOf(200)) @@ -119,10 +112,10 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found")]) - @RequestMapping( + @GetMapping( value = ["/pet/{petId}"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + produces = ["application/xml", "application/json"] + ) fun getPetById(@ApiParam(value = "ID of pet to return", required=true) @PathVariable("petId") petId: kotlin.Long ): ResponseEntity { return ResponseEntity(service.getPetById(petId), HttpStatus.valueOf(200)) @@ -135,10 +128,10 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found"),ApiResponse(code = 405, message = "Validation exception")]) - @RequestMapping( + @PutMapping( value = ["/pet"], - consumes = ["application/json", "application/xml"], - method = [RequestMethod.PUT]) + consumes = ["application/json", "application/xml"] + ) fun updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody body: Pet ): ResponseEntity { return ResponseEntity(service.updatePet(body), HttpStatus.valueOf(400)) @@ -151,10 +144,10 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 405, message = "Invalid input")]) - @RequestMapping( + @PostMapping( value = ["/pet/{petId}"], - consumes = ["application/x-www-form-urlencoded"], - method = [RequestMethod.POST]) + consumes = ["application/x-www-form-urlencoded"] + ) fun updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required=true) @PathVariable("petId") petId: kotlin.Long ,@ApiParam(value = "Updated name of the pet") @RequestParam(value="name", required=false) name: kotlin.String? ,@ApiParam(value = "Updated status of the pet") @RequestParam(value="status", required=false) status: kotlin.String? @@ -170,11 +163,11 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse::class)]) - @RequestMapping( + @PostMapping( value = ["/pet/{petId}/uploadImage"], - produces = ["application/json"], - consumes = ["multipart/form-data"], - method = [RequestMethod.POST]) + produces = ["application/json"], + consumes = ["multipart/form-data"] + ) fun uploadFile(@ApiParam(value = "ID of pet to update", required=true) @PathVariable("petId") petId: kotlin.Long ,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) additionalMetadata: kotlin.String? ,@ApiParam(value = "file detail") @Valid @RequestPart("file") file: org.springframework.core.io.Resource? diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApi.kt index 71017e33a506..3b82141c4df5 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -12,14 +12,7 @@ import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity -import org.springframework.web.bind.annotation.RequestBody -import org.springframework.web.bind.annotation.RequestPart -import org.springframework.web.bind.annotation.RequestParam -import org.springframework.web.bind.annotation.PathVariable -import org.springframework.web.bind.annotation.RequestHeader -import org.springframework.web.bind.annotation.RequestMethod -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController +import org.springframework.web.bind.annotation.* import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired @@ -38,7 +31,7 @@ import kotlin.collections.Map @RestController @Validated -@Api(value = "Store", description = "The Store API") +@Api(value = "store", description = "The store API") @RequestMapping("\${api.base-path:/v2}") class StoreApiController(@Autowired(required = true) val service: StoreApiService) { @@ -48,9 +41,9 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors") @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) - @RequestMapping( - value = ["/store/order/{orderId}"], - method = [RequestMethod.DELETE]) + @DeleteMapping( + value = ["/store/order/{orderId}"] + ) fun deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required=true) @PathVariable("orderId") orderId: kotlin.String ): ResponseEntity { return ResponseEntity(service.deleteOrder(orderId), HttpStatus.valueOf(400)) @@ -65,10 +58,10 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.collections.Map::class, responseContainer = "Map")]) - @RequestMapping( + @GetMapping( value = ["/store/inventory"], - produces = ["application/json"], - method = [RequestMethod.GET]) + produces = ["application/json"] + ) fun getInventory(): ResponseEntity> { return ResponseEntity(service.getInventory(), HttpStatus.valueOf(200)) } @@ -80,10 +73,10 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic response = Order::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) - @RequestMapping( + @GetMapping( value = ["/store/order/{orderId}"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + produces = ["application/xml", "application/json"] + ) fun getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required=true) @PathVariable("orderId") orderId: kotlin.Long ): ResponseEntity { return ResponseEntity(service.getOrderById(orderId), HttpStatus.valueOf(200)) @@ -96,10 +89,10 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic response = Order::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid Order")]) - @RequestMapping( + @PostMapping( value = ["/store/order"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.POST]) + produces = ["application/xml", "application/json"] + ) fun placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody body: Order ): ResponseEntity { return ResponseEntity(service.placeOrder(body), HttpStatus.valueOf(200)) diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApi.kt index 1dbc304d88e4..7071afde110f 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -12,14 +12,7 @@ import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity -import org.springframework.web.bind.annotation.RequestBody -import org.springframework.web.bind.annotation.RequestPart -import org.springframework.web.bind.annotation.RequestParam -import org.springframework.web.bind.annotation.PathVariable -import org.springframework.web.bind.annotation.RequestHeader -import org.springframework.web.bind.annotation.RequestMethod -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController +import org.springframework.web.bind.annotation.* import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest import org.springframework.beans.factory.annotation.Autowired @@ -38,7 +31,7 @@ import kotlin.collections.Map @RestController @Validated -@Api(value = "User", description = "The User API") +@Api(value = "user", description = "The user API") @RequestMapping("\${api.base-path:/v2}") class UserApiController(@Autowired(required = true) val service: UserApiService) { @@ -48,9 +41,9 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "This can only be done by the logged in user.") @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @RequestMapping( - value = ["/user"], - method = [RequestMethod.POST]) + @PostMapping( + value = ["/user"] + ) fun createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody body: User ): ResponseEntity { return ResponseEntity(service.createUser(body), HttpStatus.valueOf(200)) @@ -62,9 +55,9 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "") @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @RequestMapping( - value = ["/user/createWithArray"], - method = [RequestMethod.POST]) + @PostMapping( + value = ["/user/createWithArray"] + ) fun createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody body: kotlin.collections.List ): ResponseEntity { return ResponseEntity(service.createUsersWithArrayInput(body), HttpStatus.valueOf(200)) @@ -76,9 +69,9 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "") @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @RequestMapping( - value = ["/user/createWithList"], - method = [RequestMethod.POST]) + @PostMapping( + value = ["/user/createWithList"] + ) fun createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody body: kotlin.collections.List ): ResponseEntity { return ResponseEntity(service.createUsersWithListInput(body), HttpStatus.valueOf(200)) @@ -90,9 +83,9 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "This can only be done by the logged in user.") @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) - @RequestMapping( - value = ["/user/{username}"], - method = [RequestMethod.DELETE]) + @DeleteMapping( + value = ["/user/{username}"] + ) fun deleteUser(@ApiParam(value = "The name that needs to be deleted", required=true) @PathVariable("username") username: kotlin.String ): ResponseEntity { return ResponseEntity(service.deleteUser(username), HttpStatus.valueOf(400)) @@ -105,10 +98,10 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) response = User::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = User::class),ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) - @RequestMapping( + @GetMapping( value = ["/user/{username}"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + produces = ["application/xml", "application/json"] + ) fun getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") username: kotlin.String ): ResponseEntity { return ResponseEntity(service.getUserByName(username), HttpStatus.valueOf(200)) @@ -121,10 +114,10 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) response = kotlin.String::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.String::class),ApiResponse(code = 400, message = "Invalid username/password supplied")]) - @RequestMapping( + @GetMapping( value = ["/user/login"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + produces = ["application/xml", "application/json"] + ) fun loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String ,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String ): ResponseEntity { @@ -137,9 +130,9 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "") @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @RequestMapping( - value = ["/user/logout"], - method = [RequestMethod.GET]) + @GetMapping( + value = ["/user/logout"] + ) fun logoutUser(): ResponseEntity { return ResponseEntity(service.logoutUser(), HttpStatus.valueOf(200)) } @@ -150,9 +143,9 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "This can only be done by the logged in user.") @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid user supplied"),ApiResponse(code = 404, message = "User not found")]) - @RequestMapping( - value = ["/user/{username}"], - method = [RequestMethod.PUT]) + @PutMapping( + value = ["/user/{username}"] + ) fun updateUser(@ApiParam(value = "name that need to be deleted", required=true) @PathVariable("username") username: kotlin.String ,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody body: User ): ResponseEntity { diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt index 4b26b45aa17c..106585ec1500 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt @@ -9,6 +9,7 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size +import javax.validation.Valid import io.swagger.annotations.ApiModelProperty /** diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 20f2e157d476..9916aaf62e38 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -9,6 +9,7 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size +import javax.validation.Valid import io.swagger.annotations.ApiModelProperty /** diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt index 39a980deede1..2cfdd429793a 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt @@ -10,6 +10,7 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size +import javax.validation.Valid import io.swagger.annotations.ApiModelProperty /** @@ -39,7 +40,7 @@ data class Order( @field:JsonProperty("status") var status: Order.Status? = null, @ApiModelProperty(example = "null", value = "") - @field:JsonProperty("complete") var complete: kotlin.Boolean? = null + @field:JsonProperty("complete") var complete: kotlin.Boolean? = false ) { /** diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt index 974d6647ac38..88d1eb64f41b 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt @@ -12,6 +12,7 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size +import javax.validation.Valid import io.swagger.annotations.ApiModelProperty /** @@ -25,20 +26,20 @@ import io.swagger.annotations.ApiModelProperty */ data class Pet( - @get:NotNull @ApiModelProperty(example = "doggie", required = true, value = "") - @field:JsonProperty("name") var name: kotlin.String, + @field:JsonProperty("name", required = true) var name: kotlin.String, - @get:NotNull @ApiModelProperty(example = "null", required = true, value = "") - @field:JsonProperty("photoUrls") var photoUrls: kotlin.collections.List, + @field:JsonProperty("photoUrls", required = true) var photoUrls: kotlin.collections.List, @ApiModelProperty(example = "null", value = "") @field:JsonProperty("id") var id: kotlin.Long? = null, + @field:Valid @ApiModelProperty(example = "null", value = "") @field:JsonProperty("category") var category: Category? = null, + @field:Valid @ApiModelProperty(example = "null", value = "") @field:JsonProperty("tags") var tags: kotlin.collections.List? = null, diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt index 817a4af7e41b..77fc054dc915 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt @@ -9,6 +9,7 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size +import javax.validation.Valid import io.swagger.annotations.ApiModelProperty /** diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt index 8995281f28dc..58ba8f5177b8 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt @@ -9,6 +9,7 @@ import javax.validation.constraints.Min import javax.validation.constraints.NotNull import javax.validation.constraints.Pattern import javax.validation.constraints.Size +import javax.validation.Valid import io.swagger.annotations.ApiModelProperty /** diff --git a/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION b/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION index d99e7162d01f..3fa3b389a57d 100644 --- a/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.0-SNAPSHOT \ No newline at end of file +5.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Order.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Order.kt index 2d806e9e2fc0..f3dfdd42e316 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Order.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Order.kt @@ -31,7 +31,7 @@ data class Order ( var id: kotlin.Long? = null, var petId: kotlin.Long? = null, var quantity: kotlin.Int? = null, - var shipDate: java.time.LocalDateTime? = null, + var shipDate: java.time.OffsetDateTime? = null, /* Order Status */ var status: Order.Status? = null, var complete: kotlin.Boolean? = null