From 499ca33a97b9fa5a59dda661aa62f120a4904612 Mon Sep 17 00:00:00 2001 From: Joost Sijm Date: Fri, 7 Feb 2025 10:42:47 +0100 Subject: [PATCH 1/2] Fix quote --- .../src/main/resources/python/api_client.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache index 95fef884bc13..36963bad003a 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -553,7 +553,7 @@ class ApiClient(object): if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': - new_params.extend((k, value) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == 'ssv': delimiter = ' ' From 29427a018b60a3dd81c75348cd41eaf1ca22ddea Mon Sep 17 00:00:00 2001 From: Joost Sijm Date: Fri, 7 Feb 2025 13:52:48 +0100 Subject: [PATCH 2/2] Fix problem with quote Replace special characters in string using the %xx escape. Letters, digits, and the characters '_.-~' are never quoted. https://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote --- .../src/main/resources/python/api_client.mustache | 2 +- .../src/main/resources/python/api_doc.mustache | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache index 36963bad003a..3c409c17b9d4 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -516,7 +516,7 @@ class ApiClient(object): if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': - new_params.extend((k, value) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == 'ssv': delimiter = ' ' diff --git a/modules/openapi-generator/src/main/resources/python/api_doc.mustache b/modules/openapi-generator/src/main/resources/python/api_doc.mustache index 22153c4051d3..c7dfa06377ad 100644 --- a/modules/openapi-generator/src/main/resources/python/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_doc.mustache @@ -62,6 +62,7 @@ Name | Type | Description | Notes {{#responses.0}} ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| {{#responses}}