diff --git a/pom.xml b/pom.xml index f5087028da65..4f7cb54b224a 100644 --- a/pom.xml +++ b/pom.xml @@ -1243,9 +1243,9 @@ samples/client/petstore/elixir samples/client/petstore/erlang-client samples/client/petstore/erlang-proper - + samples/client/petstore/kotlin-string/ samples/server/petstore/erlang-server samples/server/petstore/jaxrs/jersey2 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 e6ebe7982db1..def00253aed0 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 @@ -74,10 +74,12 @@ open class ApiClient(val baseUrl: String) { protected fun updateAuthParams(requestConfig: RequestConfig) { if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"] + " " + apiKey["api_key"] - } else { - requestConfig.headers["api_key"] = apiKey["api_key"] + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! + } else { + requestConfig.headers["api_key"] = apiKey["api_key"]!! + } } } if (requestConfig.headers[Authorization].isNullOrEmpty()) { 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 e6ebe7982db1..def00253aed0 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 @@ -74,10 +74,12 @@ open class ApiClient(val baseUrl: String) { protected fun updateAuthParams(requestConfig: RequestConfig) { if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"] + " " + apiKey["api_key"] - } else { - requestConfig.headers["api_key"] = apiKey["api_key"] + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! + } else { + requestConfig.headers["api_key"] = apiKey["api_key"]!! + } } } if (requestConfig.headers[Authorization].isNullOrEmpty()) {