fsbahman / apidoc-swagger

apidoc and swagger are two nice projects which are focusing on documentation of APIs. This project is a middle tier which tries to bring them together in a sense that it uses apidoc to convert inline documentation to json schema and later convert it to swagger json schmea.
Other
251 stars 129 forks source link

length is null #34

Open krausz23 opened 6 years ago

krausz23 commented 6 years ago

hello, I hope this is a bug. var matches = pattern.exec(url); and we want to use the matches.length but sometimes we got a null because the matches hasn't lenght. If you have time please check this in apidocToSwagger.js file.

so I corrected myself locally: if(matches) { for (var j = 1; j < matches.length; j++) { var key = matches[j].substr(1); url = url.replace(matches[j], "{" + key + "}"); pathKeys.push(key); } }