diff --git a/modules/swagger-codegen/src/main/resources/python/api.mustache b/modules/swagger-codegen/src/main/resources/python/api.mustache index 32c10a00fa5..758aaf56b1a 100644 --- a/modules/swagger-codegen/src/main/resources/python/api.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api.mustache @@ -19,6 +19,7 @@ NOTE: This class is auto generated by the swagger code generator program. Do not """ import sys import os +import urllib from models import * @@ -78,6 +79,7 @@ class {{classname}}(object): {{#pathParams}} if ('{{paramName}}' in params): replacement = str(self.apiClient.toPathValue(params['{{paramName}}'])) + replacement = urllib.quote(replacement) resourcePath = resourcePath.replace('{' + '{{baseName}}' + '}', replacement) {{/pathParams}} diff --git a/modules/swagger-codegen/src/main/resources/python/swagger.mustache b/modules/swagger-codegen/src/main/resources/python/swagger.mustache index 1cfc60981be..0acf9974225 100644 --- a/modules/swagger-codegen/src/main/resources/python/swagger.mustache +++ b/modules/swagger-codegen/src/main/resources/python/swagger.mustache @@ -103,9 +103,9 @@ class ApiClient(object): string -- quoted value """ if type(obj) == list: - return urllib.quote(','.join(obj)) + return ','.join(obj) else: - return urllib.quote(str(obj)) + return str(obj) @staticmethod def sanitizeForSerialization(obj):