Skip to content

Commit 2254814

Browse files
committed
properly handle dictionary parameters via 'requests' client library
1 parent d0f6b5c commit 2254814

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Initial release to public.
1717
* Adds `--fix` recipe to correct non-canonical initial Python module comments
1818
post-text rendering due to misformatted templates inherited from the public
1919
`swagger-codegen` release. This option causes well-formed initial comments
20-
ti be proiduced, which consist of a U**x-compatible shell script shebang line
20+
to be produced, which consist of a U**x-compatible shell script shebang line
2121
followed by a PEP 263-conformant character encoding specification
2222
(see `partial_header.mustache`). All content currently generated presumes
2323
UTF-8 encoding, but alternate encodings may be supported in the future.

swagger_python_codegen/templates/rest.mustache

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,14 @@ class RESTClientObject: # pylint:disable=too-few-public-methods
9292
headers = headers or {}
9393
content_type = headers.setdefault('Content-Type', 'application/json')
9494

95+
for i, (k, v) in enumerate(query_params or []):
96+
if isinstance(v, dict):
97+
query_params[i] = (k, str(v))
98+
99+
for i, (k, v) in enumerate(post_params or []):
100+
if isinstance(v, dict):
101+
post_params[i] = (k, str(v))
102+
95103
request_params = dict(params=query_params, headers=headers, stream=not _preload_content,
96104
timeout=_request_timeout)
97105
if 'json' in content_type.lower():

0 commit comments

Comments
 (0)