Do not create operations for non-HTTP methods/verbs

Fixes #678
This commit is contained in:
Jeremy Whitlock
2014-10-27 19:36:02 -06:00
parent cdd02ad8a3
commit 295fa75dc4

View File

@@ -415,6 +415,9 @@ SwaggerClient.prototype.buildFromSpec = function(response) {
if(typeof response.paths[path] === 'object') { if(typeof response.paths[path] === 'object') {
var httpMethod; var httpMethod;
for(httpMethod in response.paths[path]) { for(httpMethod in response.paths[path]) {
if(['delete', 'get', 'head', 'options', 'patch', 'post', 'put'].indexOf(httpMethod) === -1) {
continue;
}
var operation = response.paths[path][httpMethod]; var operation = response.paths[path][httpMethod];
var tags = operation.tags; var tags = operation.tags;
if(typeof tags === 'undefined') { if(typeof tags === 'undefined') {