From 57afa9716684476e43b48a0777d0ba80fb4c4737 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@users.noreply.github.com> Date: Tue, 2 Nov 2021 15:32:42 +0000 Subject: [PATCH] [kotlin][client] add base url key (#10633) * [kotlin][client] add base url key * [kotlin][client] update sample projects * [kotlin][client] add base url key --- .../kotlin-client/libraries/jvm-okhttp/api.mustache | 2 +- .../jvm-okhttp/infrastructure/ApiClient.kt.mustache | 1 + .../jvm-retrofit2/infrastructure/ApiClient.kt.mustache | 5 ++++- .../main/kotlin/org/openapitools/client/apis/DefaultApi.kt | 2 +- .../org/openapitools/client/infrastructure/ApiClient.kt | 1 + .../src/main/kotlin/org/openapitools/client/apis/PetApi.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/StoreApi.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/UserApi.kt | 2 +- .../org/openapitools/client/infrastructure/ApiClient.kt | 1 + .../src/main/kotlin/org/openapitools/client/apis/PetApi.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/StoreApi.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/UserApi.kt | 2 +- .../org/openapitools/client/infrastructure/ApiClient.kt | 1 + .../src/main/kotlin/org/openapitools/client/apis/PetApi.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/StoreApi.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/UserApi.kt | 2 +- .../org/openapitools/client/infrastructure/ApiClient.kt | 1 + .../src/main/kotlin/org/openapitools/client/apis/PetApi.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/StoreApi.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/UserApi.kt | 2 +- .../org/openapitools/client/infrastructure/ApiClient.kt | 1 + .../src/main/kotlin/org/openapitools/client/apis/PetApi.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/StoreApi.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/UserApi.kt | 2 +- .../org/openapitools/client/infrastructure/ApiClient.kt | 1 + .../src/main/kotlin/org/openapitools/client/apis/PetApi.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/StoreApi.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/UserApi.kt | 2 +- .../org/openapitools/client/infrastructure/ApiClient.kt | 1 + .../src/main/kotlin/org/openapitools/client/apis/PetApi.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/StoreApi.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/UserApi.kt | 2 +- .../org/openapitools/client/infrastructure/ApiClient.kt | 1 + .../src/main/kotlin/org/openapitools/client/apis/PetApi.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/StoreApi.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/UserApi.kt | 2 +- .../org/openapitools/client/infrastructure/ApiClient.kt | 1 + .../org/openapitools/client/infrastructure/ApiClient.kt | 5 ++++- .../org/openapitools/client/infrastructure/ApiClient.kt | 5 ++++- .../org/openapitools/client/infrastructure/ApiClient.kt | 5 ++++- .../src/main/kotlin/org/openapitools/client/apis/PetApi.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/StoreApi.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/UserApi.kt | 2 +- .../org/openapitools/client/infrastructure/ApiClient.kt | 1 + .../src/main/kotlin/org/openapitools/client/apis/PetApi.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/StoreApi.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/UserApi.kt | 2 +- .../org/openapitools/client/infrastructure/ApiClient.kt | 1 + .../src/main/kotlin/org/openapitools/client/apis/EnumApi.kt | 2 +- .../org/openapitools/client/infrastructure/ApiClient.kt | 1 + .../src/main/kotlin/org/openapitools/client/apis/PetApi.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/StoreApi.kt | 2 +- .../src/main/kotlin/org/openapitools/client/apis/UserApi.kt | 2 +- .../org/openapitools/client/infrastructure/ApiClient.kt | 1 + 54 files changed, 66 insertions(+), 40 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache index be0dfa8d9c2..b10027d96d9 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache @@ -27,7 +27,7 @@ import {{packageName}}.infrastructure.toMultiValue companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("{{packageName}}.baseUrl", "{{{basePath}}}") + System.getProperties().getProperty(ApiClient.baseUrlKey, "{{{basePath}}}") } } 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 70a44277235..57bd33d35bf 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 @@ -90,6 +90,7 @@ import com.squareup.moshi.adapter var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "{{packageName}}.baseUrl" @JvmStatic val client: OkHttpClient by lazy { diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache index 2d64978b0c2..3d0c640bf6a 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache @@ -324,9 +324,12 @@ import okhttp3.MediaType.Companion.toMediaType } companion object { + @JvmStatic + protected val baseUrlKey = "{{packageName}}.baseUrl" + @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("{{packageName}}.baseUrl", "{{{basePath}}}") + System.getProperties().getProperty(baseUrlKey, "{{{basePath}}}") } } } diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index 48829a1408e..692d45bb7bc 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -38,7 +38,7 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://localhost") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://localhost") } } diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index c5dc803570a..634abe57b90 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -44,6 +44,7 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic val client: OkHttpClient by lazy { diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 40670673b69..61d5c3c17dc 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -39,7 +39,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index dcd1f62cea7..1f7110f7345 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -38,7 +38,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 94443903760..cab8811cb9a 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -38,7 +38,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } 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 a1d5839b900..7a1fafd594e 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 @@ -44,6 +44,7 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic val client: OkHttpClient by lazy { diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 40670673b69..61d5c3c17dc 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -39,7 +39,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index dcd1f62cea7..1f7110f7345 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -38,7 +38,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 94443903760..cab8811cb9a 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -38,7 +38,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } 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 9519cfa7381..05f77db3037 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 @@ -44,6 +44,7 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic val client: OkHttpClient by lazy { diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 0749111d3e6..4d5a0839a9a 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -39,7 +39,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index dcd1f62cea7..1f7110f7345 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -38,7 +38,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 94443903760..cab8811cb9a 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -38,7 +38,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } 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 b191f42e355..c4700a70115 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 @@ -45,6 +45,7 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic val client: OkHttpClient by lazy { diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index ebc04af4962..5a06839c04f 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -41,7 +41,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 6349ba587bd..5d94fcbaf2f 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -40,7 +40,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 62b8abae696..1c4318cc141 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -40,7 +40,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } 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 66b6d06546f..c6bd90a8cbe 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 @@ -47,6 +47,7 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic val client: OkHttpClient by lazy { diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 40670673b69..61d5c3c17dc 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -39,7 +39,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index dcd1f62cea7..1f7110f7345 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -38,7 +38,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 94443903760..cab8811cb9a 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -38,7 +38,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } 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 4da62720f74..c75d4889d2e 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 @@ -44,6 +44,7 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic val client: OkHttpClient by lazy { diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 5d1237fe7f0..b7dde071d16 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -39,7 +39,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index eaba8410d1b..6270b0a3c9a 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -38,7 +38,7 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index f9b43b19735..e26be752ea6 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -38,7 +38,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } 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 6c086b53454..cb6d8697017 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 @@ -44,6 +44,7 @@ internal open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic val client: OkHttpClient by lazy { diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 8c27503582d..fa0cb7d36bf 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -39,7 +39,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index c616a2dd05c..ce4b876d3f0 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -38,7 +38,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index c65ff9948ae..5b79bd86336 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -38,7 +38,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } 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 4da62720f74..c75d4889d2e 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 @@ -44,6 +44,7 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic val client: OkHttpClient by lazy { diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 40670673b69..61d5c3c17dc 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -39,7 +39,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index dcd1f62cea7..1f7110f7345 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -38,7 +38,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 94443903760..cab8811cb9a 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -38,7 +38,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } 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 bd1d00d6e5d..217d6fe0199 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 @@ -42,6 +42,7 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic val client: OkHttpClient by lazy { diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 3bb7d9c4d66..46bb56cee10 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -201,9 +201,12 @@ class ApiClient( } companion object { + @JvmStatic + protected val baseUrlKey = "org.openapitools.client.baseUrl" + @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(baseUrlKey, "http://petstore.swagger.io/v2") } } } diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 51a186e48fa..11032f9f16c 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -204,9 +204,12 @@ class ApiClient( } companion object { + @JvmStatic + protected val baseUrlKey = "org.openapitools.client.baseUrl" + @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(baseUrlKey, "http://petstore.swagger.io/v2") } } } diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 4aa4323fc5b..2197b6acb7a 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -201,9 +201,12 @@ class ApiClient( } companion object { + @JvmStatic + protected val baseUrlKey = "org.openapitools.client.baseUrl" + @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(baseUrlKey, "http://petstore.swagger.io/v2") } } } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 3847bd974ef..cdc858064fb 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -39,7 +39,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index dcd1f62cea7..1f7110f7345 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -38,7 +38,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 94443903760..cab8811cb9a 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -38,7 +38,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } 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 4da62720f74..c75d4889d2e 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 @@ -44,6 +44,7 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic val client: OkHttpClient by lazy { diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 40670673b69..61d5c3c17dc 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -39,7 +39,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index dcd1f62cea7..1f7110f7345 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -38,7 +38,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 94443903760..cab8811cb9a 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -38,7 +38,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } 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 f81000598ca..f82c6d3fa4c 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 @@ -44,6 +44,7 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic val client: OkHttpClient by lazy { diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt index 59ed587ef74..dfe73f1e363 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt @@ -38,7 +38,7 @@ class EnumApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } 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 c5dc803570a..634abe57b90 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 @@ -44,6 +44,7 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic val client: OkHttpClient by lazy { diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 40670673b69..61d5c3c17dc 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -39,7 +39,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index dcd1f62cea7..1f7110f7345 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -38,7 +38,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 94443903760..cab8811cb9a 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -38,7 +38,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { companion object { @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2") } } 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 4da62720f74..c75d4889d2e 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 @@ -44,6 +44,7 @@ open class ApiClient(val baseUrl: String) { var username: String? = null var password: String? = null var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" @JvmStatic val client: OkHttpClient by lazy {