forked from loafle/openapi-generator-original
ISSUE#4391 - https://github.com/swagger-api/swagger-codegen/issues/4391 (#4392)
This change removes '/' from the set of "safe" characters for the python urllib quote function. When using PathParams containing a '/' character, the Python client does not encode the '/'. As a result, the / is interpreted as a path separator rather than a parameter value. PathSegments must encode the / character for proper transfer of information. e.g. 'my/string' should be encoded to 'my%2Fstring' for correct transmission of a PathParam argument. Path separators must only be used between path segments.
This commit is contained in:
parent
695417699c
commit
c366f139e2
@ -107,7 +107,7 @@ class ApiClient(object):
|
||||
collection_formats)
|
||||
for k, v in path_params:
|
||||
resource_path = resource_path.replace(
|
||||
'{%s}' % k, quote(str(v), safe=""))
|
||||
'{%s}' % k, quote(str(v), safe='')) # no safe chars, encode everything
|
||||
|
||||
# query parameters
|
||||
if query_params:
|
||||
|
Loading…
x
Reference in New Issue
Block a user