Merge pull request #91 from predicador37/master
Fixes Issue #68 in a generic way for any param with any regex
This commit is contained in:
@@ -572,8 +572,8 @@
|
||||
param = _ref[_i];
|
||||
if (param.paramType === 'path') {
|
||||
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];
|
||||
} else {
|
||||
throw "" + param.name + " is a required path param.";
|
||||
|
||||
Reference in New Issue
Block a user