From 6a080d3a0c26015262120cdd9e7f4f2feeb59b23 Mon Sep 17 00:00:00 2001 From: Takuro Wada Date: Fri, 6 Jan 2017 01:55:55 +0900 Subject: [PATCH] add safe argument to quote method in python template to avoid unquoted parameter in path parameter (#4457) Closes #4391 --- .../src/main/resources/python/api_client.mustache | 2 +- samples/client/petstore/python/petstore_api/api_client.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 eb8b73c7bdf..9fa64efcca5 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))) + '{%s}' % k, quote(str(v), safe="")) # query parameters if query_params: diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index d4a40cfcbfd..f161cfb9f99 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -116,7 +116,7 @@ class ApiClient(object): collection_formats) for k, v in path_params: resource_path = resource_path.replace( - '{%s}' % k, quote(str(v))) + '{%s}' % k, quote(str(v), safe="")) # query parameters if query_params: