forked from loafle/openapi-generator-original
fixed path variable double uri-encoded issue
This commit is contained in:
@@ -5,10 +5,6 @@ class {{classname}}
|
||||
basePath = "{{basePath}}"
|
||||
# apiInvoker = APIInvoker
|
||||
|
||||
def self.escapeString(string)
|
||||
URI.encode(string.to_s)
|
||||
end
|
||||
|
||||
{{#operation}}
|
||||
{{newline}}
|
||||
# {{summary}}
|
||||
@@ -34,7 +30,7 @@ class {{classname}}
|
||||
}.merge(opts)
|
||||
|
||||
#resource path
|
||||
path = "{{path}}".sub('{format}','json'){{#pathParams}}.sub('{' + '{{baseName}}' + '}', escapeString({{paramName}}))
|
||||
path = "{{path}}".sub('{format}','json'){{#pathParams}}.sub('{' + '{{baseName}}' + '}', {{paramName}})
|
||||
{{/pathParams}}{{newline}}
|
||||
|
||||
# pull querystring keys from options
|
||||
|
||||
@@ -74,11 +74,6 @@ module Swagger
|
||||
def interpreted_path
|
||||
p = self.path.dup
|
||||
|
||||
# Fill in the path params
|
||||
self.params.each_pair do |key, value|
|
||||
p = p.gsub("{#{key}}", value.to_s)
|
||||
end
|
||||
|
||||
# Stick a .{format} placeholder into the path if there isn't
|
||||
# one already or an actual format like json or xml
|
||||
# e.g. /words/blah => /words.{format}/blah
|
||||
|
||||
Reference in New Issue
Block a user