Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions openapi/templates/api_client.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -522,10 +522,13 @@ class ApiClient:
if isinstance(v, dict):
v = json.dumps(v)

encoded_key = quote(str(k))
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(
(encoded_key, quote(str(value))) for value in v
)
else:
if collection_format == 'ssv':
delimiter = ' '
Expand All @@ -536,10 +539,10 @@ class ApiClient:
else: # csv is the default
delimiter = ','
new_params.append(
(k, delimiter.join(quote(str(value)) for value in v))
(encoded_key, delimiter.join(quote(str(value)) for value in v))
)
else:
new_params.append((k, quote(str(v))))
new_params.append((encoded_key, quote(str(v))))

return "&".join(["=".join(map(str, item)) for item in new_params])

Expand Down
9 changes: 6 additions & 3 deletions src/rapidata/api_client/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,10 +514,13 @@ def parameters_to_url_query(self, params, collection_formats):
if isinstance(v, dict):
v = json.dumps(v)

encoded_key = quote(str(k))
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(
(encoded_key, quote(str(value))) for value in v
)
else:
if collection_format == 'ssv':
delimiter = ' '
Expand All @@ -528,10 +531,10 @@ def parameters_to_url_query(self, params, collection_formats):
else: # csv is the default
delimiter = ','
new_params.append(
(k, delimiter.join(quote(str(value)) for value in v))
(encoded_key, delimiter.join(quote(str(value)) for value in v))
)
else:
new_params.append((k, quote(str(v))))
new_params.append((encoded_key, quote(str(v))))

return "&".join(["=".join(map(str, item)) for item in new_params])

Expand Down
Loading