diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java index c98ffd60e72e25585953e2c184f5738148532f23..5c9b27ae59d9329ab89f12c81f5f94c1062e512a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java @@ -525,7 +525,6 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { setLibrary(JVM_OKHTTP); // jvm specific supporting files - supportingFiles.add(new SupportingFile("infrastructure/ApplicationDelegates.kt.mustache", infrastructureFolder, "ApplicationDelegates.kt")); supportingFiles.add(new SupportingFile("infrastructure/Errors.kt.mustache", infrastructureFolder, "Errors.kt")); supportingFiles.add(new SupportingFile("infrastructure/ResponseExtensions.kt.mustache", infrastructureFolder, "ResponseExtensions.kt")); supportingFiles.add(new SupportingFile("infrastructure/ApiInfrastructureResponse.kt.mustache", infrastructureFolder, "ApiInfrastructureResponse.kt")); 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 ba46e7331955c615cc431d0257d415311e50d432..31b83578e7ebdfe9dde905c7617892ace16228e5 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 @@ -60,7 +60,7 @@ import java.util.concurrent.atomic.AtomicLong .add(LocalDateAdapter()) .add(UUIDAdapter()) .add(ByteArrayAdapter()) - .add(UriAdapter()) + .add(URIAdapter()) {{^moshiCodeGen}} .add(KotlinJsonAdapterFactory()) {{/moshiCodeGen}} @@ -105,8 +105,8 @@ import java.util.concurrent.atomic.AtomicLong contextual(AtomicInteger::class, AtomicIntegerAdapter) contextual(AtomicLong::class, AtomicLongAdapter) contextual(AtomicBoolean::class, AtomicBooleanAdapter) - contextual(URI::class, UriAdapter) - contextual(URL::class, UrlAdapter) + contextual(URI::class, URIAdapter) + contextual(URL::class, URLAdapter) contextual(StringBuilder::class, StringBuilderAdapter) } diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/URIAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/URIAdapter.kt.mustache index 20dd42023e8e707fe1ee45150a0f20435ea38b5d..c95829555534e05d3b6f32c32ad5f4d0b8ed4486 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/URIAdapter.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/URIAdapter.kt.mustache @@ -16,17 +16,17 @@ import com.squareup.moshi.ToJson import java.net.URI {{#moshi}} -{{#nonPublicApi}}internal {{/nonPublicApi}}class UriAdapter { +{{#nonPublicApi}}internal {{/nonPublicApi}}class URIAdapter { @ToJson fun toJson(uri: URI) = uri.toString() @FromJson - fun fromJson(s: String) = URI.create(s) + fun fromJson(s: String): URI = URI.create(s) } {{/moshi}} {{#kotlinx_serialization}} @Serializer(forClass = URI::class) -object UriAdapter : KSerializer<URI> { +object URIAdapter : KSerializer<URI> { override fun serialize(encoder: Encoder, value: URI) { encoder.encodeString(value.toASCIIString()) } diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/URLAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/URLAdapter.kt.mustache index 7105c43b72b66f789cdc158b91bc95fb23cff7ec..eaebad52cc8f4f7dea4a7c193d1e0f76e3e34176 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/URLAdapter.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/URLAdapter.kt.mustache @@ -10,7 +10,7 @@ import kotlinx.serialization.descriptors.SerialDescriptor import java.net.URL @Serializer(forClass = URL::class) -object UrlAdapter : KSerializer<URL> { +object URLAdapter : KSerializer<URL> { override fun serialize(encoder: Encoder, value: URL) { encoder.encodeString(value.toExternalForm()) } diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/UUIDAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/UUIDAdapter.kt.mustache index 9781ff529ccd1ca10df40de6d6076b49eb9be022..ea903c36ca99e045a1d80e9c2b73657beee58ac7 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/UUIDAdapter.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/UUIDAdapter.kt.mustache @@ -21,7 +21,7 @@ import java.util.UUID fun toJson(uuid: UUID) = uuid.toString() @FromJson - fun fromJson(s: String) = UUID.fromString(s) + fun fromJson(s: String): UUID = UUID.fromString(s) } {{/moshi}} {{#kotlinx_serialization}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache index 2c0c8d8930a389d92c3e9627196dab4f2c04d0b9..64ab00cf9b6dc8b1dbcbeae64bbb18e09f746730 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache @@ -3,7 +3,11 @@ package {{packageName}}.infrastructure {{#supportAndroidApiLevel25AndBelow}} import android.os.Build {{/supportAndroidApiLevel25AndBelow}} +{{#hasAuthMethods}} +{{#isBasicBasic}} import okhttp3.Credentials +{{/isBasicBasic}} +{{/hasAuthMethods}} import okhttp3.OkHttpClient import okhttp3.RequestBody {{#jvm-okhttp3}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApplicationDelegates.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApplicationDelegates.kt.mustache deleted file mode 100644 index 6311226317642b93cb4aafa53f0a0865a7822dd0..0000000000000000000000000000000000000000 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApplicationDelegates.kt.mustache +++ /dev/null @@ -1,29 +0,0 @@ -package {{packageName}}.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -{{#nonPublicApi}}internal {{/nonPublicApi}}object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun <T> setOnce(defaultValue: T? = null) : ReadWriteProperty<Any?, T> = SetOnce(defaultValue) - - private class SetOnce<T>(defaultValue: T? = null) : ReadWriteProperty<Any?, T> { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultGeneratorTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultGeneratorTest.java index dac059152231bd48978858f7ac1dce3256fa196e..7e6a986bb3242e78d5f9f1d576f7717e0325b376 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultGeneratorTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultGeneratorTest.java @@ -459,7 +459,7 @@ public class DefaultGeneratorTest { List<File> files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 27); + Assert.assertEquals(files.size(), 26); // Generator should report a library templated file as a generated file TestUtils.ensureContainsFile(files, output, "src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt"); @@ -501,7 +501,7 @@ public class DefaultGeneratorTest { List<File> files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 27); + Assert.assertEquals(files.size(), 26); // Generator should report README.md as a generated file TestUtils.ensureContainsFile(files, output, "README.md"); @@ -566,7 +566,7 @@ public class DefaultGeneratorTest { List<File> files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 27); + Assert.assertEquals(files.size(), 26); // Generator should report a library templated file as a generated file TestUtils.ensureContainsFile(files, output, "src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt"); @@ -620,7 +620,7 @@ public class DefaultGeneratorTest { List<File> files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 27); + Assert.assertEquals(files.size(), 26); // Generator should report README.md as a generated file TestUtils.ensureContainsFile(files, output, "README.md"); diff --git a/samples/client/petstore/kotlin-gson/.openapi-generator/FILES b/samples/client/petstore/kotlin-gson/.openapi-generator/FILES index bf441309074d45210afde969d07eff6c54ec1a61..1f38d3fbe2d371395b9a0f200f5d011a7d3d765c 100644 --- a/samples/client/petstore/kotlin-gson/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-gson/.openapi-generator/FILES @@ -20,7 +20,6 @@ src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index e8c4090e06794131ff1bdcfc34240ca0e5b76951..8ba19ee8e157f02843bdce726e6788d6ae9d390d 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -1,6 +1,5 @@ package org.openapitools.client.infrastructure -import okhttp3.Credentials import okhttp3.OkHttpClient import okhttp3.RequestBody import okhttp3.RequestBody.Companion.asRequestBody diff --git a/samples/client/petstore/kotlin-jackson/.openapi-generator/FILES b/samples/client/petstore/kotlin-jackson/.openapi-generator/FILES index 6bfd310bbcad8cd878a73d9ddbe2f94e347ec69f..816d952128d88fd8ebaa7a6461ee69ff85e599ad 100644 --- a/samples/client/petstore/kotlin-jackson/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-jackson/.openapi-generator/FILES @@ -20,7 +20,6 @@ src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 0c29beb9558a5f0aeb68d553a7d476c731ac3ea0..6cf2ef9b0d10c6f887dcdeccd9b5a26809e8875b 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -1,6 +1,5 @@ package org.openapitools.client.infrastructure -import okhttp3.Credentials import okhttp3.OkHttpClient import okhttp3.RequestBody import okhttp3.RequestBody.Companion.asRequestBody diff --git a/samples/client/petstore/kotlin-json-request-string/.openapi-generator/FILES b/samples/client/petstore/kotlin-json-request-string/.openapi-generator/FILES index ca4c31651a4841bb6724d564a71ba65e1c0c4120..16c712325f82b210b869bdb46f2c6e28604716ba 100644 --- a/samples/client/petstore/kotlin-json-request-string/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-json-request-string/.openapi-generator/FILES @@ -20,7 +20,6 @@ src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index ea327d4b6a4a3a211f3058857383a3e9fd9169f7..fc1578908831422a4a4ff5b46df0c908f60f3738 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -1,7 +1,6 @@ package org.openapitools.client.infrastructure import android.os.Build -import okhttp3.Credentials import okhttp3.OkHttpClient import okhttp3.RequestBody import okhttp3.RequestBody.Companion.asRequestBody 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 5b6d177ca89335389c9f9a35a9c8d2cce7f3d44b..e77581231c316ebc86d8d8a044f7bf28a8cbe4b3 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 @@ -12,7 +12,7 @@ object Serializer { .add(LocalDateAdapter()) .add(UUIDAdapter()) .add(ByteArrayAdapter()) - .add(UriAdapter()) + .add(URIAdapter()) .add(KotlinJsonAdapterFactory()) .add(BigDecimalAdapter()) .add(BigIntegerAdapter()) diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt index 87de0b17353bcffd86bb30f3c65296979b0535cc..927522757da988da98a0b4db9e5d264ff7a47984 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt @@ -4,10 +4,10 @@ import com.squareup.moshi.FromJson import com.squareup.moshi.ToJson import java.net.URI -class UriAdapter { +class URIAdapter { @ToJson fun toJson(uri: URI) = uri.toString() @FromJson - fun fromJson(s: String) = URI.create(s) + fun fromJson(s: String): URI = URI.create(s) } diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt index a4a44cc18b73e4a0ec722fa385e0276dbfbac670..7ccf7dc25d2dd273ffc5b4a54f6e779f44706ad5 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt @@ -9,5 +9,5 @@ class UUIDAdapter { fun toJson(uuid: UUID) = uuid.toString() @FromJson - fun fromJson(s: String) = UUID.fromString(s) + fun fromJson(s: String): UUID = UUID.fromString(s) } diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/FILES b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/FILES index bf441309074d45210afde969d07eff6c54ec1a61..1f38d3fbe2d371395b9a0f200f5d011a7d3d765c 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/FILES @@ -20,7 +20,6 @@ src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index e8c4090e06794131ff1bdcfc34240ca0e5b76951..8ba19ee8e157f02843bdce726e6788d6ae9d390d 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -1,6 +1,5 @@ package org.openapitools.client.infrastructure -import okhttp3.Credentials import okhttp3.OkHttpClient import okhttp3.RequestBody import okhttp3.RequestBody.Companion.asRequestBody diff --git a/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/FILES b/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/FILES index ca4c31651a4841bb6724d564a71ba65e1c0c4120..16c712325f82b210b869bdb46f2c6e28604716ba 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/FILES @@ -20,7 +20,6 @@ src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 0961cf760c64cffcd7fbd598b40dd50e311e022f..ae6e80e95062ab5734221211829248d5825f8c86 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -1,6 +1,5 @@ package org.openapitools.client.infrastructure -import okhttp3.Credentials import okhttp3.OkHttpClient import okhttp3.RequestBody import okhttp3.RequestBody.Companion.asRequestBody 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 e1cee08d055bcab856e43ce6111964d9321a6952..ebd1a2a526b0a92c708fc1cc6ddccc5357962107 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 @@ -11,7 +11,7 @@ object Serializer { .add(LocalDateAdapter()) .add(UUIDAdapter()) .add(ByteArrayAdapter()) - .add(UriAdapter()) + .add(URIAdapter()) .add(BigDecimalAdapter()) .add(BigIntegerAdapter()) diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt index 87de0b17353bcffd86bb30f3c65296979b0535cc..927522757da988da98a0b4db9e5d264ff7a47984 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt @@ -4,10 +4,10 @@ import com.squareup.moshi.FromJson import com.squareup.moshi.ToJson import java.net.URI -class UriAdapter { +class URIAdapter { @ToJson fun toJson(uri: URI) = uri.toString() @FromJson - fun fromJson(s: String) = URI.create(s) + fun fromJson(s: String): URI = URI.create(s) } diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt index a4a44cc18b73e4a0ec722fa385e0276dbfbac670..7ccf7dc25d2dd273ffc5b4a54f6e779f44706ad5 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt @@ -9,5 +9,5 @@ class UUIDAdapter { fun toJson(uuid: UUID) = uuid.toString() @FromJson - fun fromJson(s: String) = UUID.fromString(s) + fun fromJson(s: String): UUID = UUID.fromString(s) } diff --git a/samples/client/petstore/kotlin-nonpublic/.openapi-generator/FILES b/samples/client/petstore/kotlin-nonpublic/.openapi-generator/FILES index ca4c31651a4841bb6724d564a71ba65e1c0c4120..16c712325f82b210b869bdb46f2c6e28604716ba 100644 --- a/samples/client/petstore/kotlin-nonpublic/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-nonpublic/.openapi-generator/FILES @@ -20,7 +20,6 @@ src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index d4fccce2715b8a90089c1b476dbf1c826c1c594e..ed34dce24467fcc254a859d901768986daf1ef33 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -1,6 +1,5 @@ package org.openapitools.client.infrastructure -import okhttp3.Credentials import okhttp3.OkHttpClient import okhttp3.RequestBody import okhttp3.RequestBody.Companion.asRequestBody 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 914d277df5e7e399eae42a3373030f259cfac3a3..acc0b33ae20c31a5fb6c45d85faa24d94d8978d5 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 @@ -12,7 +12,7 @@ internal object Serializer { .add(LocalDateAdapter()) .add(UUIDAdapter()) .add(ByteArrayAdapter()) - .add(UriAdapter()) + .add(URIAdapter()) .add(KotlinJsonAdapterFactory()) .add(BigDecimalAdapter()) .add(BigIntegerAdapter()) diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt index bfe92917615069a505c0e564aee6cfa66b63b609..3e509e9a83158f9c6c91f00ea866aeeaef852e30 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt @@ -4,10 +4,10 @@ import com.squareup.moshi.FromJson import com.squareup.moshi.ToJson import java.net.URI -internal class UriAdapter { +internal class URIAdapter { @ToJson fun toJson(uri: URI) = uri.toString() @FromJson - fun fromJson(s: String) = URI.create(s) + fun fromJson(s: String): URI = URI.create(s) } diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt index 02fa692b57dc15c0e066e3738786ce014fc50cce..b5de20257ba1478850b32c0f7bdeed3a25968b2a 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt @@ -9,5 +9,5 @@ internal class UUIDAdapter { fun toJson(uuid: UUID) = uuid.toString() @FromJson - fun fromJson(s: String) = UUID.fromString(s) + fun fromJson(s: String): UUID = UUID.fromString(s) } diff --git a/samples/client/petstore/kotlin-nullable/.openapi-generator/FILES b/samples/client/petstore/kotlin-nullable/.openapi-generator/FILES index ca4c31651a4841bb6724d564a71ba65e1c0c4120..16c712325f82b210b869bdb46f2c6e28604716ba 100644 --- a/samples/client/petstore/kotlin-nullable/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-nullable/.openapi-generator/FILES @@ -20,7 +20,6 @@ src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 0961cf760c64cffcd7fbd598b40dd50e311e022f..ae6e80e95062ab5734221211829248d5825f8c86 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -1,6 +1,5 @@ package org.openapitools.client.infrastructure -import okhttp3.Credentials import okhttp3.OkHttpClient import okhttp3.RequestBody import okhttp3.RequestBody.Companion.asRequestBody 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 5b6d177ca89335389c9f9a35a9c8d2cce7f3d44b..e77581231c316ebc86d8d8a044f7bf28a8cbe4b3 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 @@ -12,7 +12,7 @@ object Serializer { .add(LocalDateAdapter()) .add(UUIDAdapter()) .add(ByteArrayAdapter()) - .add(UriAdapter()) + .add(URIAdapter()) .add(KotlinJsonAdapterFactory()) .add(BigDecimalAdapter()) .add(BigIntegerAdapter()) diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt index 87de0b17353bcffd86bb30f3c65296979b0535cc..927522757da988da98a0b4db9e5d264ff7a47984 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt @@ -4,10 +4,10 @@ import com.squareup.moshi.FromJson import com.squareup.moshi.ToJson import java.net.URI -class UriAdapter { +class URIAdapter { @ToJson fun toJson(uri: URI) = uri.toString() @FromJson - fun fromJson(s: String) = URI.create(s) + fun fromJson(s: String): URI = URI.create(s) } diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt index a4a44cc18b73e4a0ec722fa385e0276dbfbac670..7ccf7dc25d2dd273ffc5b4a54f6e779f44706ad5 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt @@ -9,5 +9,5 @@ class UUIDAdapter { fun toJson(uuid: UUID) = uuid.toString() @FromJson - fun fromJson(s: String) = UUID.fromString(s) + fun fromJson(s: String): UUID = UUID.fromString(s) } diff --git a/samples/client/petstore/kotlin-okhttp3/.openapi-generator/FILES b/samples/client/petstore/kotlin-okhttp3/.openapi-generator/FILES index ca4c31651a4841bb6724d564a71ba65e1c0c4120..16c712325f82b210b869bdb46f2c6e28604716ba 100644 --- a/samples/client/petstore/kotlin-okhttp3/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-okhttp3/.openapi-generator/FILES @@ -20,7 +20,6 @@ src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 49cf4c675b7e67d983c556becc00ab7bc8d9c345..538c66cec2e37dee298575ae89d1a1de3d442dbd 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -1,6 +1,5 @@ package org.openapitools.client.infrastructure -import okhttp3.Credentials import okhttp3.OkHttpClient import okhttp3.RequestBody import okhttp3.MediaType 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 5b6d177ca89335389c9f9a35a9c8d2cce7f3d44b..e77581231c316ebc86d8d8a044f7bf28a8cbe4b3 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 @@ -12,7 +12,7 @@ object Serializer { .add(LocalDateAdapter()) .add(UUIDAdapter()) .add(ByteArrayAdapter()) - .add(UriAdapter()) + .add(URIAdapter()) .add(KotlinJsonAdapterFactory()) .add(BigDecimalAdapter()) .add(BigIntegerAdapter()) diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt index 87de0b17353bcffd86bb30f3c65296979b0535cc..927522757da988da98a0b4db9e5d264ff7a47984 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt @@ -4,10 +4,10 @@ import com.squareup.moshi.FromJson import com.squareup.moshi.ToJson import java.net.URI -class UriAdapter { +class URIAdapter { @ToJson fun toJson(uri: URI) = uri.toString() @FromJson - fun fromJson(s: String) = URI.create(s) + fun fromJson(s: String): URI = URI.create(s) } diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt index a4a44cc18b73e4a0ec722fa385e0276dbfbac670..7ccf7dc25d2dd273ffc5b4a54f6e779f44706ad5 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt @@ -9,5 +9,5 @@ class UUIDAdapter { fun toJson(uuid: UUID) = uuid.toString() @FromJson - fun fromJson(s: String) = UUID.fromString(s) + fun fromJson(s: String): UUID = UUID.fromString(s) } diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index 624053c30742c9a6942928016a2731754bba0fad..e769dec78ea36696a8e30a36928f0a26e99d5c39 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -28,8 +28,8 @@ object Serializer { contextual(AtomicInteger::class, AtomicIntegerAdapter) contextual(AtomicLong::class, AtomicLongAdapter) contextual(AtomicBoolean::class, AtomicBooleanAdapter) - contextual(URI::class, UriAdapter) - contextual(URL::class, UrlAdapter) + contextual(URI::class, URIAdapter) + contextual(URL::class, URLAdapter) contextual(StringBuilder::class, StringBuilderAdapter) } diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt index 0b734134afaf6cd88447f20badb53b0f0fcf5e85..0856c99813c11a2b24d0de58f4161dc36307dcdc 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt @@ -10,7 +10,7 @@ import kotlinx.serialization.descriptors.SerialDescriptor import java.net.URI @Serializer(forClass = URI::class) -object UriAdapter : KSerializer<URI> { +object URIAdapter : KSerializer<URI> { override fun serialize(encoder: Encoder, value: URI) { encoder.encodeString(value.toASCIIString()) } diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/URLAdapter.kt b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/URLAdapter.kt index 29546fc3ce9e5e0ceee61e837f20460c1f31cb21..2df3308b76a3420965c4a4c02a3223ef68916d17 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/URLAdapter.kt +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/URLAdapter.kt @@ -10,7 +10,7 @@ import kotlinx.serialization.descriptors.SerialDescriptor import java.net.URL @Serializer(forClass = URL::class) -object UrlAdapter : KSerializer<URL> { +object URLAdapter : KSerializer<URL> { override fun serialize(encoder: Encoder, value: URL) { encoder.encodeString(value.toExternalForm()) } 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 5b6d177ca89335389c9f9a35a9c8d2cce7f3d44b..e77581231c316ebc86d8d8a044f7bf28a8cbe4b3 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 @@ -12,7 +12,7 @@ object Serializer { .add(LocalDateAdapter()) .add(UUIDAdapter()) .add(ByteArrayAdapter()) - .add(UriAdapter()) + .add(URIAdapter()) .add(KotlinJsonAdapterFactory()) .add(BigDecimalAdapter()) .add(BigIntegerAdapter()) diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt index 87de0b17353bcffd86bb30f3c65296979b0535cc..927522757da988da98a0b4db9e5d264ff7a47984 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt +++ b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt @@ -4,10 +4,10 @@ import com.squareup.moshi.FromJson import com.squareup.moshi.ToJson import java.net.URI -class UriAdapter { +class URIAdapter { @ToJson fun toJson(uri: URI) = uri.toString() @FromJson - fun fromJson(s: String) = URI.create(s) + fun fromJson(s: String): URI = URI.create(s) } diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt index a4a44cc18b73e4a0ec722fa385e0276dbfbac670..7ccf7dc25d2dd273ffc5b4a54f6e779f44706ad5 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt @@ -9,5 +9,5 @@ class UUIDAdapter { fun toJson(uuid: UUID) = uuid.toString() @FromJson - fun fromJson(s: String) = UUID.fromString(s) + fun fromJson(s: String): UUID = UUID.fromString(s) } 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 5b6d177ca89335389c9f9a35a9c8d2cce7f3d44b..e77581231c316ebc86d8d8a044f7bf28a8cbe4b3 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 @@ -12,7 +12,7 @@ object Serializer { .add(LocalDateAdapter()) .add(UUIDAdapter()) .add(ByteArrayAdapter()) - .add(UriAdapter()) + .add(URIAdapter()) .add(KotlinJsonAdapterFactory()) .add(BigDecimalAdapter()) .add(BigIntegerAdapter()) diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt index 87de0b17353bcffd86bb30f3c65296979b0535cc..927522757da988da98a0b4db9e5d264ff7a47984 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt @@ -4,10 +4,10 @@ import com.squareup.moshi.FromJson import com.squareup.moshi.ToJson import java.net.URI -class UriAdapter { +class URIAdapter { @ToJson fun toJson(uri: URI) = uri.toString() @FromJson - fun fromJson(s: String) = URI.create(s) + fun fromJson(s: String): URI = URI.create(s) } diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt index a4a44cc18b73e4a0ec722fa385e0276dbfbac670..7ccf7dc25d2dd273ffc5b4a54f6e779f44706ad5 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt @@ -9,5 +9,5 @@ class UUIDAdapter { fun toJson(uuid: UUID) = uuid.toString() @FromJson - fun fromJson(s: String) = UUID.fromString(s) + fun fromJson(s: String): UUID = UUID.fromString(s) } diff --git a/samples/client/petstore/kotlin-string/.openapi-generator/FILES b/samples/client/petstore/kotlin-string/.openapi-generator/FILES index ca4c31651a4841bb6724d564a71ba65e1c0c4120..16c712325f82b210b869bdb46f2c6e28604716ba 100644 --- a/samples/client/petstore/kotlin-string/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-string/.openapi-generator/FILES @@ -20,7 +20,6 @@ src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 0961cf760c64cffcd7fbd598b40dd50e311e022f..ae6e80e95062ab5734221211829248d5825f8c86 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -1,6 +1,5 @@ package org.openapitools.client.infrastructure -import okhttp3.Credentials import okhttp3.OkHttpClient import okhttp3.RequestBody import okhttp3.RequestBody.Companion.asRequestBody 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 5b6d177ca89335389c9f9a35a9c8d2cce7f3d44b..e77581231c316ebc86d8d8a044f7bf28a8cbe4b3 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 @@ -12,7 +12,7 @@ object Serializer { .add(LocalDateAdapter()) .add(UUIDAdapter()) .add(ByteArrayAdapter()) - .add(UriAdapter()) + .add(URIAdapter()) .add(KotlinJsonAdapterFactory()) .add(BigDecimalAdapter()) .add(BigIntegerAdapter()) diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt index 87de0b17353bcffd86bb30f3c65296979b0535cc..927522757da988da98a0b4db9e5d264ff7a47984 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt @@ -4,10 +4,10 @@ import com.squareup.moshi.FromJson import com.squareup.moshi.ToJson import java.net.URI -class UriAdapter { +class URIAdapter { @ToJson fun toJson(uri: URI) = uri.toString() @FromJson - fun fromJson(s: String) = URI.create(s) + fun fromJson(s: String): URI = URI.create(s) } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt index a4a44cc18b73e4a0ec722fa385e0276dbfbac670..7ccf7dc25d2dd273ffc5b4a54f6e779f44706ad5 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt @@ -9,5 +9,5 @@ class UUIDAdapter { fun toJson(uuid: UUID) = uuid.toString() @FromJson - fun fromJson(s: String) = UUID.fromString(s) + fun fromJson(s: String): UUID = UUID.fromString(s) } diff --git a/samples/client/petstore/kotlin-threetenbp/.openapi-generator/FILES b/samples/client/petstore/kotlin-threetenbp/.openapi-generator/FILES index ca4c31651a4841bb6724d564a71ba65e1c0c4120..16c712325f82b210b869bdb46f2c6e28604716ba 100644 --- a/samples/client/petstore/kotlin-threetenbp/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-threetenbp/.openapi-generator/FILES @@ -20,7 +20,6 @@ src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 27297844d606d2316bf84c75fc68a44589977a21..ad394bbefb02d94b7e7725ade4a2a6ab04af7165 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -1,6 +1,5 @@ package org.openapitools.client.infrastructure -import okhttp3.Credentials import okhttp3.OkHttpClient import okhttp3.RequestBody import okhttp3.RequestBody.Companion.asRequestBody 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 5b6d177ca89335389c9f9a35a9c8d2cce7f3d44b..e77581231c316ebc86d8d8a044f7bf28a8cbe4b3 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 @@ -12,7 +12,7 @@ object Serializer { .add(LocalDateAdapter()) .add(UUIDAdapter()) .add(ByteArrayAdapter()) - .add(UriAdapter()) + .add(URIAdapter()) .add(KotlinJsonAdapterFactory()) .add(BigDecimalAdapter()) .add(BigIntegerAdapter()) diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt index 87de0b17353bcffd86bb30f3c65296979b0535cc..927522757da988da98a0b4db9e5d264ff7a47984 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt @@ -4,10 +4,10 @@ import com.squareup.moshi.FromJson import com.squareup.moshi.ToJson import java.net.URI -class UriAdapter { +class URIAdapter { @ToJson fun toJson(uri: URI) = uri.toString() @FromJson - fun fromJson(s: String) = URI.create(s) + fun fromJson(s: String): URI = URI.create(s) } diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt index a4a44cc18b73e4a0ec722fa385e0276dbfbac670..7ccf7dc25d2dd273ffc5b4a54f6e779f44706ad5 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt @@ -9,5 +9,5 @@ class UUIDAdapter { fun toJson(uuid: UUID) = uuid.toString() @FromJson - fun fromJson(s: String) = UUID.fromString(s) + fun fromJson(s: String): UUID = UUID.fromString(s) } diff --git a/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/FILES b/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/FILES index bfbf9941fa5777c1e162fef8244e568f7027eac4..c817d80248481521575e83d36d10af89640f70c5 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/FILES @@ -11,7 +11,6 @@ src/main/kotlin/org/openapitools/client/apis/EnumApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 0dad05161fae71532c87050dc43fbe0a8ca8fd9d..e65bce97f7e64e24d89c373fba918670f8d68aa3 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -1,6 +1,5 @@ package org.openapitools.client.infrastructure -import okhttp3.Credentials import okhttp3.OkHttpClient import okhttp3.RequestBody import okhttp3.RequestBody.Companion.asRequestBody 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 5b6d177ca89335389c9f9a35a9c8d2cce7f3d44b..e77581231c316ebc86d8d8a044f7bf28a8cbe4b3 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 @@ -12,7 +12,7 @@ object Serializer { .add(LocalDateAdapter()) .add(UUIDAdapter()) .add(ByteArrayAdapter()) - .add(UriAdapter()) + .add(URIAdapter()) .add(KotlinJsonAdapterFactory()) .add(BigDecimalAdapter()) .add(BigIntegerAdapter()) diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt index 87de0b17353bcffd86bb30f3c65296979b0535cc..927522757da988da98a0b4db9e5d264ff7a47984 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt @@ -4,10 +4,10 @@ import com.squareup.moshi.FromJson import com.squareup.moshi.ToJson import java.net.URI -class UriAdapter { +class URIAdapter { @ToJson fun toJson(uri: URI) = uri.toString() @FromJson - fun fromJson(s: String) = URI.create(s) + fun fromJson(s: String): URI = URI.create(s) } diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt index a4a44cc18b73e4a0ec722fa385e0276dbfbac670..7ccf7dc25d2dd273ffc5b4a54f6e779f44706ad5 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt @@ -9,5 +9,5 @@ class UUIDAdapter { fun toJson(uuid: UUID) = uuid.toString() @FromJson - fun fromJson(s: String) = UUID.fromString(s) + fun fromJson(s: String): UUID = UUID.fromString(s) } diff --git a/samples/client/petstore/kotlin/.openapi-generator/FILES b/samples/client/petstore/kotlin/.openapi-generator/FILES index ca4c31651a4841bb6724d564a71ba65e1c0c4120..16c712325f82b210b869bdb46f2c6e28604716ba 100644 --- a/samples/client/petstore/kotlin/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin/.openapi-generator/FILES @@ -20,7 +20,6 @@ src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 0961cf760c64cffcd7fbd598b40dd50e311e022f..ae6e80e95062ab5734221211829248d5825f8c86 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -1,6 +1,5 @@ package org.openapitools.client.infrastructure -import okhttp3.Credentials import okhttp3.OkHttpClient import okhttp3.RequestBody import okhttp3.RequestBody.Companion.asRequestBody 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 5b6d177ca89335389c9f9a35a9c8d2cce7f3d44b..e77581231c316ebc86d8d8a044f7bf28a8cbe4b3 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 @@ -12,7 +12,7 @@ object Serializer { .add(LocalDateAdapter()) .add(UUIDAdapter()) .add(ByteArrayAdapter()) - .add(UriAdapter()) + .add(URIAdapter()) .add(KotlinJsonAdapterFactory()) .add(BigDecimalAdapter()) .add(BigIntegerAdapter()) diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt index 87de0b17353bcffd86bb30f3c65296979b0535cc..927522757da988da98a0b4db9e5d264ff7a47984 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt @@ -4,10 +4,10 @@ import com.squareup.moshi.FromJson import com.squareup.moshi.ToJson import java.net.URI -class UriAdapter { +class URIAdapter { @ToJson fun toJson(uri: URI) = uri.toString() @FromJson - fun fromJson(s: String) = URI.create(s) + fun fromJson(s: String): URI = URI.create(s) } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt index a4a44cc18b73e4a0ec722fa385e0276dbfbac670..7ccf7dc25d2dd273ffc5b4a54f6e779f44706ad5 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt @@ -9,5 +9,5 @@ class UUIDAdapter { fun toJson(uuid: UUID) = uuid.toString() @FromJson - fun fromJson(s: String) = UUID.fromString(s) + fun fromJson(s: String): UUID = UUID.fromString(s) }