Browse Source

fixes https://github.com/wordnik/swagger-core/issues/68 in a generic way. Should work with all params.

bubble
predicador37 12 years ago
parent
commit
30886478d4
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      lib/swagger.js

+ 2
- 2
lib/swagger.js View File

@@ -572,8 +572,8 @@
param = _ref[_i]; param = _ref[_i];
if (param.paramType === 'path') { if (param.paramType === 'path') {
if (args[param.name]) { if (args[param.name]) {
url = url.replace(/{id.*/, '{id}');
url = url.replace("{" + param.name + "}", encodeURIComponent(args[param.name]));
reg = new RegExp('\{'+param.name+'[^\}]*\}', 'gi');
url = url.replace(reg, encodeURIComponent(args[param.name]));
delete args[param.name]; delete args[param.name];
} else { } else {
throw "" + param.name + " is a required path param."; throw "" + param.name + " is a required path param.";


Loading…
Cancel
Save