Explorar el Código

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

bubble
predicador37 hace 12 años
padre
commit
30886478d4
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. +2
    -2
      lib/swagger.js

+ 2
- 2
lib/swagger.js Ver fichero

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


Cargando…
Cancelar
Guardar