fixed path variable double uri-encoded issue

This commit is contained in:
William Cheng
2015-04-02 16:15:08 +08:00
parent 2bb42a1147
commit a717aba826
2 changed files with 1 additions and 10 deletions
@@ -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