fixed issue that query parameters double url encoded

This commit is contained in:
geekerzp 2015-03-30 10:34:01 +08:00
parent 517c0a4f52
commit 8f6afda99a
2 changed files with 4 additions and 2 deletions

View File

@ -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}}

View File

@ -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):