Skip to content

Commit 0beb8ca

Browse files
authored
reenable kotlin client tests in shippable ci (#3751)
1 parent 1f5aa22 commit 0beb8ca

File tree

3 files changed

+14
-10
lines changed
  • samples/client/petstore
    • kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure
    • kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure

3 files changed

+14
-10
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,9 +1243,9 @@
12431243
<module>samples/client/petstore/elixir</module>
12441244
<module>samples/client/petstore/erlang-client</module>
12451245
<module>samples/client/petstore/erlang-proper</module>
1246-
<!--<module>samples/client/petstore/kotlin/</module>
1246+
<module>samples/client/petstore/kotlin/</module>
12471247
<module>samples/client/petstore/kotlin-threetenbp/</module>
1248-
<module>samples/client/petstore/kotlin-string/</module>-->
1248+
<module>samples/client/petstore/kotlin-string/</module>
12491249
<!-- servers -->
12501250
<module>samples/server/petstore/erlang-server</module>
12511251
<module>samples/server/petstore/jaxrs/jersey2</module>

samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,12 @@ open class ApiClient(val baseUrl: String) {
7474

7575
protected fun updateAuthParams(requestConfig: RequestConfig) {
7676
if (requestConfig.headers["api_key"].isNullOrEmpty()) {
77-
if (apiKeyPrefix["api_key"] != null) {
78-
requestConfig.headers["api_key"] = apiKeyPrefix["api_key"] + " " + apiKey["api_key"]
79-
} else {
80-
requestConfig.headers["api_key"] = apiKey["api_key"]
77+
if (apiKey["api_key"] != null) {
78+
if (apiKeyPrefix["api_key"] != null) {
79+
requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!
80+
} else {
81+
requestConfig.headers["api_key"] = apiKey["api_key"]!!
82+
}
8183
}
8284
}
8385
if (requestConfig.headers[Authorization].isNullOrEmpty()) {

samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,12 @@ open class ApiClient(val baseUrl: String) {
7474

7575
protected fun updateAuthParams(requestConfig: RequestConfig) {
7676
if (requestConfig.headers["api_key"].isNullOrEmpty()) {
77-
if (apiKeyPrefix["api_key"] != null) {
78-
requestConfig.headers["api_key"] = apiKeyPrefix["api_key"] + " " + apiKey["api_key"]
79-
} else {
80-
requestConfig.headers["api_key"] = apiKey["api_key"]
77+
if (apiKey["api_key"] != null) {
78+
if (apiKeyPrefix["api_key"] != null) {
79+
requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!
80+
} else {
81+
requestConfig.headers["api_key"] = apiKey["api_key"]!!
82+
}
8183
}
8284
}
8385
if (requestConfig.headers[Authorization].isNullOrEmpty()) {

0 commit comments

Comments
 (0)