Skip to content

Commit

Permalink
fix: enable disabling of operation_id_case_convention (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
Richienb committed Jul 26, 2021
1 parent a063dbc commit 5ffb9fb
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,17 @@ module.exports.validate = function({ jsSpec, resolvedSpec, isOAS3 }, config) {
} else {
// check operationId for case convention
const checkStatus = config.operation_id_case_convention[0];
const caseConvention = config.operation_id_case_convention[1];
const isCorrectCase = checkCase(op.operationId, caseConvention);
if (!isCorrectCase) {
messages.addMessage(
`paths.${pathKey}.${opKey}.operationId`,
`operationIds must follow case convention: ${caseConvention}`,
checkStatus,
'operation_id_case_convention'
);
if (checkStatus !== 'off') {
const caseConvention = config.operation_id_case_convention[1];
const isCorrectCase = checkCase(op.operationId, caseConvention);
if (!isCorrectCase) {
messages.addMessage(
`paths.${pathKey}.${opKey}.operationId`,
`operationIds must follow case convention: ${caseConvention}`,
checkStatus,
'operation_id_case_convention'
);
}
}
}
const hasOperationTags = op.tags && op.tags.length > 0;
Expand Down

0 comments on commit 5ffb9fb

Please sign in to comment.