linter: Fix checking for inline refs.

The current linter disallowed the pattern
where multiple refs were present without
an additional parameter in allOf, which should
be valid.

Fixed the condition to allow the change.
This commit is contained in:
Suyash Vardhan Mathur
2021-06-07 22:13:45 +05:30
committed by Tim Abbott
parent 31d85e2d3b
commit fbf9de671a

View File

@@ -13,7 +13,7 @@ function checkRefSiblings(file, path, data) {
if (typeof data === "object" && data !== null) {
if (
"allOf" in data &&
Object.values(data.allOf).filter((subschema) => !("$ref" in subschema)).length !== 1
Object.values(data.allOf).filter((subschema) => !("$ref" in subschema)).length > 1
) {
console.error(
`${file}: Too many inline allOf subschemas at ${JSON.stringify(