Skip to content

Commit a2b37d6

Browse files
andrewemerywing328
authored andcommitted
Kotlin query collection format (#4248)
* Fixes incorrect query header collection constants The OpenApi codegen converts OpenApi v2 documents into an OpenApi v3 representation. The query parameter collection formats are squeezed into different values from the raw OpenApi 2 collection format values. For example: csv -> space See: DefaultCodegen#getCollectionFormat * Updates kotlin samples
1 parent c8465c4 commit a2b37d6

9 files changed

Lines changed: 18 additions & 18 deletions

File tree

modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ApiAbstractions.kt.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ typealias MultiValueMap = MutableMap<String,List<String>>
55
{{#nonPublicApi}}internal {{/nonPublicApi}}fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) {
66
"csv" -> ","
77
"tsv" -> "\t"
8-
"pipes" -> "|"
9-
"ssv" -> " "
8+
"pipe" -> "|"
9+
"space" -> " "
1010
else -> ""
1111
}
1212

samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ typealias MultiValueMap = MutableMap<String,List<String>>
55
fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) {
66
"csv" -> ","
77
"tsv" -> "\t"
8-
"pipes" -> "|"
9-
"ssv" -> " "
8+
"pipe" -> "|"
9+
"space" -> " "
1010
else -> ""
1111
}
1212

samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ typealias MultiValueMap = MutableMap<String,List<String>>
55
internal fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) {
66
"csv" -> ","
77
"tsv" -> "\t"
8-
"pipes" -> "|"
9-
"ssv" -> " "
8+
"pipe" -> "|"
9+
"space" -> " "
1010
else -> ""
1111
}
1212

samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ typealias MultiValueMap = MutableMap<String,List<String>>
55
fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) {
66
"csv" -> ","
77
"tsv" -> "\t"
8-
"pipes" -> "|"
9-
"ssv" -> " "
8+
"pipe" -> "|"
9+
"space" -> " "
1010
else -> ""
1111
}
1212

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ typealias MultiValueMap = MutableMap<String,List<String>>
55
fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) {
66
"csv" -> ","
77
"tsv" -> "\t"
8-
"pipes" -> "|"
9-
"ssv" -> " "
8+
"pipe" -> "|"
9+
"space" -> " "
1010
else -> ""
1111
}
1212

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ typealias MultiValueMap = MutableMap<String,List<String>>
55
fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) {
66
"csv" -> ","
77
"tsv" -> "\t"
8-
"pipes" -> "|"
9-
"ssv" -> " "
8+
"pipe" -> "|"
9+
"space" -> " "
1010
else -> ""
1111
}
1212

samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ typealias MultiValueMap = MutableMap<String,List<String>>
55
fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) {
66
"csv" -> ","
77
"tsv" -> "\t"
8-
"pipes" -> "|"
9-
"ssv" -> " "
8+
"pipe" -> "|"
9+
"space" -> " "
1010
else -> ""
1111
}
1212

samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ typealias MultiValueMap = MutableMap<String,List<String>>
55
fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) {
66
"csv" -> ","
77
"tsv" -> "\t"
8-
"pipes" -> "|"
9-
"ssv" -> " "
8+
"pipe" -> "|"
9+
"space" -> " "
1010
else -> ""
1111
}
1212

samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ typealias MultiValueMap = MutableMap<String,List<String>>
55
fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) {
66
"csv" -> ","
77
"tsv" -> "\t"
8-
"pipes" -> "|"
9-
"ssv" -> " "
8+
"pipe" -> "|"
9+
"space" -> " "
1010
else -> ""
1111
}
1212

0 commit comments

Comments
 (0)