diff --git a/api/validator.js b/api/validator.js index 6eef652f..3b89a5a3 100644 --- a/api/validator.js +++ b/api/validator.js @@ -44,7 +44,8 @@ if (isDir) { process.exit(1); } files.forEach(function(f) { - if (f.indexOf(".yaml") > 0) { + var suffix = ".yaml"; + if (f.indexOf(suffix, f.length - suffix.length) > 0) { parser.parse(path.join(opts.schema, f), function(err, api, metadata) { if (!err) { console.log("%s is valid.", f);