mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
openapi: Fix misuse of nullable as sibling of oneOf.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Anders Kaseorg
parent
3b84dd3b8c
commit
0ba41328fd
@@ -53,6 +53,20 @@ async function checkFile(file) {
|
||||
console.error("%s:%d:%d: Siblings of $ref have no effect", file, line, col);
|
||||
ok = false;
|
||||
}
|
||||
|
||||
const combinator = ["allOf", "anyOf", "oneOf"].find((combinator) =>
|
||||
node.has(combinator),
|
||||
);
|
||||
if (node.has("nullable") && combinator !== undefined) {
|
||||
const {line, col} = lineCounter.linePos(node.range[0]);
|
||||
console.error(
|
||||
`%s:%d:%d: nullable has no effect as a sibling of ${combinator}`,
|
||||
file,
|
||||
line,
|
||||
col,
|
||||
);
|
||||
ok = false;
|
||||
}
|
||||
},
|
||||
|
||||
Pair(_key, node) {
|
||||
|
||||
Reference in New Issue
Block a user