From a2b37d67c05a9e09a047d0c5d20652326fe3d2fa Mon Sep 17 00:00:00 2001 From: Andrew Emery Date: Wed, 30 Oct 2019 01:55:04 +1100 Subject: [PATCH] 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 --- .../kotlin-client/infrastructure/ApiAbstractions.kt.mustache | 4 ++-- .../org/openapitools/client/infrastructure/ApiAbstractions.kt | 4 ++-- .../org/openapitools/client/infrastructure/ApiAbstractions.kt | 4 ++-- .../org/openapitools/client/infrastructure/ApiAbstractions.kt | 4 ++-- .../org/openapitools/client/infrastructure/ApiAbstractions.kt | 4 ++-- .../org/openapitools/client/infrastructure/ApiAbstractions.kt | 4 ++-- .../org/openapitools/client/infrastructure/ApiAbstractions.kt | 4 ++-- .../org/openapitools/client/infrastructure/ApiAbstractions.kt | 4 ++-- .../org/openapitools/client/infrastructure/ApiAbstractions.kt | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ApiAbstractions.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ApiAbstractions.kt.mustache index 12c0350232f..4b7d0599cb2 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ApiAbstractions.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ApiAbstractions.kt.mustache @@ -5,8 +5,8 @@ typealias MultiValueMap = MutableMap> {{#nonPublicApi}}internal {{/nonPublicApi}}fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { "csv" -> "," "tsv" -> "\t" - "pipes" -> "|" - "ssv" -> " " + "pipe" -> "|" + "space" -> " " else -> "" } diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt index 30d3705e5b4..ef7a8f1e1a6 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -5,8 +5,8 @@ typealias MultiValueMap = MutableMap> fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { "csv" -> "," "tsv" -> "\t" - "pipes" -> "|" - "ssv" -> " " + "pipe" -> "|" + "space" -> " " else -> "" } diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt index ed07e5d7543..6f180df2254 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -5,8 +5,8 @@ typealias MultiValueMap = MutableMap> internal fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { "csv" -> "," "tsv" -> "\t" - "pipes" -> "|" - "ssv" -> " " + "pipe" -> "|" + "space" -> " " else -> "" } diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt index 30d3705e5b4..ef7a8f1e1a6 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -5,8 +5,8 @@ typealias MultiValueMap = MutableMap> fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { "csv" -> "," "tsv" -> "\t" - "pipes" -> "|" - "ssv" -> " " + "pipe" -> "|" + "space" -> " " else -> "" } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt index 30d3705e5b4..ef7a8f1e1a6 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -5,8 +5,8 @@ typealias MultiValueMap = MutableMap> fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { "csv" -> "," "tsv" -> "\t" - "pipes" -> "|" - "ssv" -> " " + "pipe" -> "|" + "space" -> " " else -> "" } diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt index 30d3705e5b4..ef7a8f1e1a6 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -5,8 +5,8 @@ typealias MultiValueMap = MutableMap> fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { "csv" -> "," "tsv" -> "\t" - "pipes" -> "|" - "ssv" -> " " + "pipe" -> "|" + "space" -> " " else -> "" } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt index 30d3705e5b4..ef7a8f1e1a6 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -5,8 +5,8 @@ typealias MultiValueMap = MutableMap> fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { "csv" -> "," "tsv" -> "\t" - "pipes" -> "|" - "ssv" -> " " + "pipe" -> "|" + "space" -> " " else -> "" } diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt index 30d3705e5b4..ef7a8f1e1a6 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -5,8 +5,8 @@ typealias MultiValueMap = MutableMap> fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { "csv" -> "," "tsv" -> "\t" - "pipes" -> "|" - "ssv" -> " " + "pipe" -> "|" + "space" -> " " else -> "" } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt index 30d3705e5b4..ef7a8f1e1a6 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -5,8 +5,8 @@ typealias MultiValueMap = MutableMap> fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { "csv" -> "," "tsv" -> "\t" - "pipes" -> "|" - "ssv" -> " " + "pipe" -> "|" + "space" -> " " else -> "" }