From c366f139e28b4b67f11a51807580f897afccc305 Mon Sep 17 00:00:00 2001 From: Jon Hartlaub Date: Fri, 3 Feb 2017 03:24:15 -0800 Subject: [PATCH] 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. --- .../src/main/resources/python/api_client.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/python/api_client.mustache b/modules/swagger-codegen/src/main/resources/python/api_client.mustache index 9fa64efcca5..04b53afba9b 100644 --- a/modules/swagger-codegen/src/main/resources/python/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api_client.mustache @@ -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: