[python] Encode list query parameters for python pydantic v1 client (#20614)

* Fix url escape quote in python pydantic v1 client

* Fix sample
This commit is contained in:
Joost Sijm
2025-02-18 09:46:14 +01:00
committed by GitHub
parent 65df3c22b9
commit 5687edcf02
3 changed files with 4 additions and 4 deletions

View File

@@ -509,7 +509,7 @@ class ApiClient:
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(value)) for value in v)
else:
if collection_format == 'ssv':
delimiter = ' '
@@ -546,7 +546,7 @@ class ApiClient:
if k in collection_formats:
collection_format = collection_formats[k]
if collection_format == 'multi':
new_params.extend((k, str(value)) for value in v)
new_params.extend((k, quote(str(value))) for value in v)
else:
if collection_format == 'ssv':
delimiter = ' '