From 8f6afda99a6c1c156a7c348953f3d83baa8d1552 Mon Sep 17 00:00:00 2001 From: geekerzp Date: Mon, 30 Mar 2015 10:34:01 +0800 Subject: [PATCH] fixed issue that query parameters double url encoded --- .../swagger-codegen/src/main/resources/python/api.mustache | 2 ++ .../src/main/resources/python/swagger.mustache | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) 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):