mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-03 00:43:46 +00:00
[Kotlin] Introduce support for Kotlin Explicit API Mode for Kotlin-Client generator (resolve #16506) (#19999)
* [Kotlin] Properly document nonPublicApi CLI option * [Kotlin] Respect parameter name of parent KSerializer to avoid miss-behavior * [Kotlin] Introduce support for Kotlin Explicit API Mode for Kotlin-Client generator (resolves #16506)
This commit is contained in:
@@ -2,7 +2,7 @@ package org.openapitools.client.infrastructure
|
||||
|
||||
typealias MultiValueMap = MutableMap<String,List<String>>
|
||||
|
||||
fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) {
|
||||
fun collectionDelimiter(collectionFormat: String): String = when(collectionFormat) {
|
||||
"csv" -> ","
|
||||
"tsv" -> "\t"
|
||||
"pipe" -> "|"
|
||||
@@ -12,7 +12,7 @@ fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) {
|
||||
|
||||
val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" }
|
||||
|
||||
fun <T : Any?> toMultiValue(items: Array<T>, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter)
|
||||
fun <T : Any?> toMultiValue(items: Array<T>, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List<String>
|
||||
= toMultiValue(items.asIterable(), collectionFormat, map)
|
||||
|
||||
fun <T : Any?> toMultiValue(items: Iterable<T>, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List<String> {
|
||||
|
||||
@@ -49,8 +49,8 @@ open class ApiClient(
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val BASE_URL = "http://petstore.swagger.io/v2"
|
||||
protected val UNSAFE_HEADERS = listOf(HttpHeaders.ContentType)
|
||||
const val BASE_URL: String = "http://petstore.swagger.io/v2"
|
||||
protected val UNSAFE_HEADERS: List<String> = listOf(HttpHeaders.ContentType)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user