IBM/openapi-validator

`operation_id_case_convention` rule can't be easily disabled

Closed this issue ยท 2 comments

With every other case convention rule, it can be disabled like this:

{
	param_name_case_convention: ["off"]
}

If the first item in the array is "off", then the linter will skip the rule.

operation_id_case_convention is the only rule that does not follow this. Despite providing "off" as the first item, it still tries to check the case which isn't provided:

const checkStatus = config.operation_id_case_convention[0];
const caseConvention = config.operation_id_case_convention[1];
const isCorrectCase = checkCase(op.operationId, caseConvention);

The code should only run this check if checkStatus !== "off" like every other rule.

For now, a temporary workaround is to specify a case anyways which will disable the check:

{
	operation_id_case_convention: ["off", "lower_snake_case"]
}

That does sound like unexpected behavior. I will try look into that soon but I'm also happy to review a PR if you would like to open one.

๐ŸŽ‰ This issue has been resolved in version 0.46.4 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€