Skip to content

Commit b773d40

Browse files
committed
fixed path variable double uri-encoded issue
1 parent b6be19b commit b773d40

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

modules/swagger-codegen/src/main/resources/ruby/api.mustache

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ class {{classname}}
55
basePath = "{{basePath}}"
66
# apiInvoker = APIInvoker
77

8-
def self.escapeString(string)
9-
URI.encode(string.to_s)
10-
end
11-
128
{{#operation}}
139
{{newline}}
1410
# {{summary}}
@@ -33,7 +29,7 @@ class {{classname}}
3329
}.merge(opts)
3430

3531
#resource path
36-
path = "{{path}}".sub('{format}','json'){{#pathParams}}.sub('{' + '{{baseName}}' + '}', escapeString({{paramName}}))
32+
path = "{{path}}".sub('{format}','json'){{#pathParams}}.sub('{' + '{{baseName}}' + '}', {{paramName}})
3733
{{/pathParams}}{{newline}}
3834

3935
# pull querystring keys from options

modules/swagger-codegen/src/main/resources/ruby/swagger/request.mustache

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,6 @@ module Swagger
7474
def interpreted_path
7575
p = self.path.dup
7676

77-
# Fill in the path params
78-
self.params.each_pair do |key, value|
79-
p = p.gsub("{#{key}}", value.to_s)
80-
end
81-
8277
# Stick a .{format} placeholder into the path if there isn't
8378
# one already or an actual format like json or xml
8479
# e.g. /words/blah => /words.{format}/blah

0 commit comments

Comments
 (0)