mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-03 22:20:56 +00:00
fixed issue that query parameters double url encoded
This commit is contained in:
parent
517c0a4f52
commit
8f6afda99a
@ -19,6 +19,7 @@ NOTE: This class is auto generated by the swagger code generator program. Do not
|
|||||||
"""
|
"""
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
import urllib
|
||||||
|
|
||||||
from models import *
|
from models import *
|
||||||
|
|
||||||
@ -78,6 +79,7 @@ class {{classname}}(object):
|
|||||||
{{#pathParams}}
|
{{#pathParams}}
|
||||||
if ('{{paramName}}' in params):
|
if ('{{paramName}}' in params):
|
||||||
replacement = str(self.apiClient.toPathValue(params['{{paramName}}']))
|
replacement = str(self.apiClient.toPathValue(params['{{paramName}}']))
|
||||||
|
replacement = urllib.quote(replacement)
|
||||||
resourcePath = resourcePath.replace('{' + '{{baseName}}' + '}',
|
resourcePath = resourcePath.replace('{' + '{{baseName}}' + '}',
|
||||||
replacement)
|
replacement)
|
||||||
{{/pathParams}}
|
{{/pathParams}}
|
||||||
|
@ -103,9 +103,9 @@ class ApiClient(object):
|
|||||||
string -- quoted value
|
string -- quoted value
|
||||||
"""
|
"""
|
||||||
if type(obj) == list:
|
if type(obj) == list:
|
||||||
return urllib.quote(','.join(obj))
|
return ','.join(obj)
|
||||||
else:
|
else:
|
||||||
return urllib.quote(str(obj))
|
return str(obj)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def sanitizeForSerialization(obj):
|
def sanitizeForSerialization(obj):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user