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:
Ayush Gupta
2012-11-20 01:04:08 -08:00

View File

@@ -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.";