Skip to content

Commit

Permalink
add security completeness check;fix version bug
Browse files Browse the repository at this point in the history
  • Loading branch information
coliu19 committed Mar 14, 2023
1 parent b45e860 commit 7aca6bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion functions/checkPathBasedVersioning.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function (input, opts) {
? input?.servers?.every((server) => {
// check variables
const vars = Object.values(server?.variables ?? {});
const versionInVariables = vars.find((v) => re.test(v.default) && (v.enum || []).every((e) => re.test(e)));
const versionInVariables = vars.find((v) => _checkPath(v.default) && (v.enum || []).every((e) => _checkPath(e)));

// TODO: Possibly make this be an XOR (versionInVariables !== re.test(server.url))
// since it would be strange to have multiple versions...
Expand Down
2 changes: 2 additions & 0 deletions validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ export default {
'rules': {
'oas3-schema': 'error',
'oas2-schema': 'error',
'oas3-operation-security-defined': 'error',
'oas2-operation-security-defined': 'error',
},
};

0 comments on commit 7aca6bb

Please sign in to comment.