From bdc361c46860baa858701665fd4d72ceb0750588 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 22 Jul 2026 15:18:14 +0800 Subject: [PATCH 1/3] better handling of cookie in python clients --- .../src/main/resources/python/api_client.mustache | 7 ++----- .../openapi_client/api_client.py | 7 ++----- .../client/echo_api/python/openapi_client/api_client.py | 7 ++----- .../legacy_model_dict_client/api_client.py | 7 ++----- .../petstore/python-aiohttp/petstore_api/api_client.py | 7 ++----- .../petstore/python-httpx-sync/petstore_api/api_client.py | 7 ++----- .../petstore/python-httpx/petstore_api/api_client.py | 7 ++----- .../petstore/python-lazyImports/petstore_api/api_client.py | 7 ++----- .../client/petstore/python/petstore_api/api_client.py | 7 ++----- 9 files changed, 18 insertions(+), 45 deletions(-) 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 71392d82e126..a4eb7f1c2b67 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -840,11 +840,8 @@ https://github.com/OpenAPITools/openapi-generator/blob/c84b949df1a9ec04ba75989cb headers['Cookie'] = "" else: headers['Cookie'] += "; " - # Account for cookie value containing spaces and special characters - cookie_value = str(auth_setting['value']) - if not re.match("^\".*\"$", cookie_value): - cookie_value = cookie_value.replace("\"", "\\\"") - cookie_value = f"\"{cookie_value}\"" + # Account for cookie value containing spaces and special characters, excluding base64 delimiters + cookie_value = quote(str(auth_setting['value']), safe='+/=') headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api_client.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api_client.py index 594ec0e5a703..de31bfc4255a 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api_client.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api_client.py @@ -683,11 +683,8 @@ def _apply_auth_params( headers['Cookie'] = "" else: headers['Cookie'] += "; " - # Account for cookie value containing spaces and special characters - cookie_value = str(auth_setting['value']) - if not re.match("^\".*\"$", cookie_value): - cookie_value = cookie_value.replace("\"", "\\\"") - cookie_value = f"\"{cookie_value}\"" + # Account for cookie value containing spaces and special characters, excluding base64 delimiters + cookie_value = quote(str(auth_setting['value']), safe='+/=') headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': diff --git a/samples/client/echo_api/python/openapi_client/api_client.py b/samples/client/echo_api/python/openapi_client/api_client.py index 594ec0e5a703..de31bfc4255a 100644 --- a/samples/client/echo_api/python/openapi_client/api_client.py +++ b/samples/client/echo_api/python/openapi_client/api_client.py @@ -683,11 +683,8 @@ def _apply_auth_params( headers['Cookie'] = "" else: headers['Cookie'] += "; " - # Account for cookie value containing spaces and special characters - cookie_value = str(auth_setting['value']) - if not re.match("^\".*\"$", cookie_value): - cookie_value = cookie_value.replace("\"", "\\\"") - cookie_value = f"\"{cookie_value}\"" + # Account for cookie value containing spaces and special characters, excluding base64 delimiters + cookie_value = quote(str(auth_setting['value']), safe='+/=') headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': diff --git a/samples/client/others/python-legacy-model-dictionaries/legacy_model_dict_client/api_client.py b/samples/client/others/python-legacy-model-dictionaries/legacy_model_dict_client/api_client.py index 37ab9efc5d92..2803b8f60606 100644 --- a/samples/client/others/python-legacy-model-dictionaries/legacy_model_dict_client/api_client.py +++ b/samples/client/others/python-legacy-model-dictionaries/legacy_model_dict_client/api_client.py @@ -791,11 +791,8 @@ def _apply_auth_params( headers['Cookie'] = "" else: headers['Cookie'] += "; " - # Account for cookie value containing spaces and special characters - cookie_value = str(auth_setting['value']) - if not re.match("^\".*\"$", cookie_value): - cookie_value = cookie_value.replace("\"", "\\\"") - cookie_value = f"\"{cookie_value}\"" + # Account for cookie value containing spaces and special characters, excluding base64 delimiters + cookie_value = quote(str(auth_setting['value']), safe='+/=') headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py index f90151f6105b..350a0c3c7143 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py @@ -682,11 +682,8 @@ def _apply_auth_params( headers['Cookie'] = "" else: headers['Cookie'] += "; " - # Account for cookie value containing spaces and special characters - cookie_value = str(auth_setting['value']) - if not re.match("^\".*\"$", cookie_value): - cookie_value = cookie_value.replace("\"", "\\\"") - cookie_value = f"\"{cookie_value}\"" + # Account for cookie value containing spaces and special characters, excluding base64 delimiters + cookie_value = quote(str(auth_setting['value']), safe='+/=') headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': diff --git a/samples/openapi3/client/petstore/python-httpx-sync/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-httpx-sync/petstore_api/api_client.py index 5fb082d86bc9..9ad1b1bb003d 100644 --- a/samples/openapi3/client/petstore/python-httpx-sync/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-httpx-sync/petstore_api/api_client.py @@ -685,11 +685,8 @@ def _apply_auth_params( headers['Cookie'] = "" else: headers['Cookie'] += "; " - # Account for cookie value containing spaces and special characters - cookie_value = str(auth_setting['value']) - if not re.match("^\".*\"$", cookie_value): - cookie_value = cookie_value.replace("\"", "\\\"") - cookie_value = f"\"{cookie_value}\"" + # Account for cookie value containing spaces and special characters, excluding base64 delimiters + cookie_value = quote(str(auth_setting['value']), safe='+/=') headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/api_client.py index 5fb082d86bc9..9ad1b1bb003d 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/api_client.py @@ -685,11 +685,8 @@ def _apply_auth_params( headers['Cookie'] = "" else: headers['Cookie'] += "; " - # Account for cookie value containing spaces and special characters - cookie_value = str(auth_setting['value']) - if not re.match("^\".*\"$", cookie_value): - cookie_value = cookie_value.replace("\"", "\\\"") - cookie_value = f"\"{cookie_value}\"" + # Account for cookie value containing spaces and special characters, excluding base64 delimiters + cookie_value = quote(str(auth_setting['value']), safe='+/=') headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api_client.py index a26ad3c644a2..25ec1019568d 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api_client.py @@ -682,11 +682,8 @@ def _apply_auth_params( headers['Cookie'] = "" else: headers['Cookie'] += "; " - # Account for cookie value containing spaces and special characters - cookie_value = str(auth_setting['value']) - if not re.match("^\".*\"$", cookie_value): - cookie_value = cookie_value.replace("\"", "\\\"") - cookie_value = f"\"{cookie_value}\"" + # Account for cookie value containing spaces and special characters, excluding base64 delimiters + cookie_value = quote(str(auth_setting['value']), safe='+/=') headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index 4a91fbc24248..0ee51dc1b98a 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -682,11 +682,8 @@ def _apply_auth_params( headers['Cookie'] = "" else: headers['Cookie'] += "; " - # Account for cookie value containing spaces and special characters - cookie_value = str(auth_setting['value']) - if not re.match("^\".*\"$", cookie_value): - cookie_value = cookie_value.replace("\"", "\\\"") - cookie_value = f"\"{cookie_value}\"" + # Account for cookie value containing spaces and special characters, excluding base64 delimiters + cookie_value = quote(str(auth_setting['value']), safe='+/=') headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': From aaa3c6c21e3105bd3c7816bb250c117483d52dad Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 22 Jul 2026 16:15:36 +0800 Subject: [PATCH 2/3] update samples --- .../src/main/resources/python/api_client.mustache | 2 +- .../openapi_client/api_client.py | 2 +- samples/client/echo_api/python/openapi_client/api_client.py | 2 +- .../legacy_model_dict_client/api_client.py | 2 +- .../client/petstore/python-aiohttp/petstore_api/api_client.py | 2 +- .../petstore/python-httpx-sync/petstore_api/api_client.py | 2 +- .../client/petstore/python-httpx/petstore_api/api_client.py | 2 +- .../petstore/python-lazyImports/petstore_api/api_client.py | 2 +- .../openapi3/client/petstore/python/petstore_api/api_client.py | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) 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 a4eb7f1c2b67..a01a3f0422e4 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -841,7 +841,7 @@ https://github.com/OpenAPITools/openapi-generator/blob/c84b949df1a9ec04ba75989cb else: headers['Cookie'] += "; " # Account for cookie value containing spaces and special characters, excluding base64 delimiters - cookie_value = quote(str(auth_setting['value']), safe='+/=') + cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_{|}~%+/=") headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api_client.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api_client.py index de31bfc4255a..4b653f688851 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api_client.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api_client.py @@ -684,7 +684,7 @@ def _apply_auth_params( else: headers['Cookie'] += "; " # Account for cookie value containing spaces and special characters, excluding base64 delimiters - cookie_value = quote(str(auth_setting['value']), safe='+/=') + cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_{|}~%+/=") headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': diff --git a/samples/client/echo_api/python/openapi_client/api_client.py b/samples/client/echo_api/python/openapi_client/api_client.py index de31bfc4255a..4b653f688851 100644 --- a/samples/client/echo_api/python/openapi_client/api_client.py +++ b/samples/client/echo_api/python/openapi_client/api_client.py @@ -684,7 +684,7 @@ def _apply_auth_params( else: headers['Cookie'] += "; " # Account for cookie value containing spaces and special characters, excluding base64 delimiters - cookie_value = quote(str(auth_setting['value']), safe='+/=') + cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_{|}~%+/=") headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': diff --git a/samples/client/others/python-legacy-model-dictionaries/legacy_model_dict_client/api_client.py b/samples/client/others/python-legacy-model-dictionaries/legacy_model_dict_client/api_client.py index 2803b8f60606..3a55c6b30924 100644 --- a/samples/client/others/python-legacy-model-dictionaries/legacy_model_dict_client/api_client.py +++ b/samples/client/others/python-legacy-model-dictionaries/legacy_model_dict_client/api_client.py @@ -792,7 +792,7 @@ def _apply_auth_params( else: headers['Cookie'] += "; " # Account for cookie value containing spaces and special characters, excluding base64 delimiters - cookie_value = quote(str(auth_setting['value']), safe='+/=') + cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_{|}~%+/=") headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py index 350a0c3c7143..22448cc96652 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py @@ -683,7 +683,7 @@ def _apply_auth_params( else: headers['Cookie'] += "; " # Account for cookie value containing spaces and special characters, excluding base64 delimiters - cookie_value = quote(str(auth_setting['value']), safe='+/=') + cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_{|}~%+/=") headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': diff --git a/samples/openapi3/client/petstore/python-httpx-sync/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-httpx-sync/petstore_api/api_client.py index 9ad1b1bb003d..457e7276e498 100644 --- a/samples/openapi3/client/petstore/python-httpx-sync/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-httpx-sync/petstore_api/api_client.py @@ -686,7 +686,7 @@ def _apply_auth_params( else: headers['Cookie'] += "; " # Account for cookie value containing spaces and special characters, excluding base64 delimiters - cookie_value = quote(str(auth_setting['value']), safe='+/=') + cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_{|}~%+/=") headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/api_client.py index 9ad1b1bb003d..457e7276e498 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/api_client.py @@ -686,7 +686,7 @@ def _apply_auth_params( else: headers['Cookie'] += "; " # Account for cookie value containing spaces and special characters, excluding base64 delimiters - cookie_value = quote(str(auth_setting['value']), safe='+/=') + cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_{|}~%+/=") headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api_client.py index 25ec1019568d..d7d4dbaa5b8e 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api_client.py @@ -683,7 +683,7 @@ def _apply_auth_params( else: headers['Cookie'] += "; " # Account for cookie value containing spaces and special characters, excluding base64 delimiters - cookie_value = quote(str(auth_setting['value']), safe='+/=') + cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_{|}~%+/=") headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index 0ee51dc1b98a..ae894f9f0e24 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -683,7 +683,7 @@ def _apply_auth_params( else: headers['Cookie'] += "; " # Account for cookie value containing spaces and special characters, excluding base64 delimiters - cookie_value = quote(str(auth_setting['value']), safe='+/=') + cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_{|}~%+/=") headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': From 00bf9237ada06e2ae20e87eaba92261a1f732335 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 22 Jul 2026 17:29:35 +0800 Subject: [PATCH 3/3] update samples --- .../src/main/resources/python/api_client.mustache | 2 +- .../openapi_client/api_client.py | 2 +- samples/client/echo_api/python/openapi_client/api_client.py | 2 +- .../legacy_model_dict_client/api_client.py | 2 +- .../client/petstore/python-aiohttp/petstore_api/api_client.py | 2 +- .../petstore/python-httpx-sync/petstore_api/api_client.py | 2 +- .../client/petstore/python-httpx/petstore_api/api_client.py | 2 +- .../petstore/python-lazyImports/petstore_api/api_client.py | 2 +- .../openapi3/client/petstore/python/petstore_api/api_client.py | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) 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 a01a3f0422e4..f742cffb87c8 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -841,7 +841,7 @@ https://github.com/OpenAPITools/openapi-generator/blob/c84b949df1a9ec04ba75989cb else: headers['Cookie'] += "; " # Account for cookie value containing spaces and special characters, excluding base64 delimiters - cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_{|}~%+/=") + cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_`{|}~%+/=") headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api_client.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api_client.py index 4b653f688851..237696870257 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api_client.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api_client.py @@ -684,7 +684,7 @@ def _apply_auth_params( else: headers['Cookie'] += "; " # Account for cookie value containing spaces and special characters, excluding base64 delimiters - cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_{|}~%+/=") + cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_`{|}~%+/=") headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': diff --git a/samples/client/echo_api/python/openapi_client/api_client.py b/samples/client/echo_api/python/openapi_client/api_client.py index 4b653f688851..237696870257 100644 --- a/samples/client/echo_api/python/openapi_client/api_client.py +++ b/samples/client/echo_api/python/openapi_client/api_client.py @@ -684,7 +684,7 @@ def _apply_auth_params( else: headers['Cookie'] += "; " # Account for cookie value containing spaces and special characters, excluding base64 delimiters - cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_{|}~%+/=") + cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_`{|}~%+/=") headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': diff --git a/samples/client/others/python-legacy-model-dictionaries/legacy_model_dict_client/api_client.py b/samples/client/others/python-legacy-model-dictionaries/legacy_model_dict_client/api_client.py index 3a55c6b30924..97d4d8f203ef 100644 --- a/samples/client/others/python-legacy-model-dictionaries/legacy_model_dict_client/api_client.py +++ b/samples/client/others/python-legacy-model-dictionaries/legacy_model_dict_client/api_client.py @@ -792,7 +792,7 @@ def _apply_auth_params( else: headers['Cookie'] += "; " # Account for cookie value containing spaces and special characters, excluding base64 delimiters - cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_{|}~%+/=") + cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_`{|}~%+/=") headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py index 22448cc96652..f37d3564026a 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py @@ -683,7 +683,7 @@ def _apply_auth_params( else: headers['Cookie'] += "; " # Account for cookie value containing spaces and special characters, excluding base64 delimiters - cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_{|}~%+/=") + cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_`{|}~%+/=") headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': diff --git a/samples/openapi3/client/petstore/python-httpx-sync/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-httpx-sync/petstore_api/api_client.py index 457e7276e498..a82e242f5afe 100644 --- a/samples/openapi3/client/petstore/python-httpx-sync/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-httpx-sync/petstore_api/api_client.py @@ -686,7 +686,7 @@ def _apply_auth_params( else: headers['Cookie'] += "; " # Account for cookie value containing spaces and special characters, excluding base64 delimiters - cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_{|}~%+/=") + cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_`{|}~%+/=") headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/api_client.py index 457e7276e498..a82e242f5afe 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/api_client.py @@ -686,7 +686,7 @@ def _apply_auth_params( else: headers['Cookie'] += "; " # Account for cookie value containing spaces and special characters, excluding base64 delimiters - cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_{|}~%+/=") + cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_`{|}~%+/=") headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api_client.py index d7d4dbaa5b8e..21489d50fb24 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api_client.py @@ -683,7 +683,7 @@ def _apply_auth_params( else: headers['Cookie'] += "; " # Account for cookie value containing spaces and special characters, excluding base64 delimiters - cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_{|}~%+/=") + cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_`{|}~%+/=") headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index ae894f9f0e24..03370346fde2 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -683,7 +683,7 @@ def _apply_auth_params( else: headers['Cookie'] += "; " # Account for cookie value containing spaces and special characters, excluding base64 delimiters - cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_{|}~%+/=") + cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_`{|}~%+/=") headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature':