Skip to content

Commit

Permalink
Fix securitySchemeWithName - needed to return the object value instea…
Browse files Browse the repository at this point in the history
…d of the whole object
  • Loading branch information
kevinrenskers committed Aug 7, 2016
1 parent f851f36 commit 2980ef2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Expand Up @@ -67,7 +67,11 @@ function getDefaultConfig(mainTemplate, templatesPath) {

// Add extra function for finding a security scheme by name
ramlObj.securitySchemeWithName = function (name) {
return ramlObj.securitySchemes.find((scheme) => scheme[name]);
const result = ramlObj.securitySchemes.find(s => s[name]);
if (result) {
return result[name];
}
return {};
};

// Parse securedBy and use scopes if they are defined
Expand Down

0 comments on commit 2980ef2

Please sign in to comment.