mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +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) {
|
||||
|
@@ -4191,11 +4191,11 @@ paths:
|
||||
value:
|
||||
description: |
|
||||
The new value of the property.
|
||||
nullable: true
|
||||
oneOf:
|
||||
- type: string
|
||||
- type: boolean
|
||||
- type: integer
|
||||
nullable: true
|
||||
example:
|
||||
{
|
||||
"type": "realm",
|
||||
|
Reference in New Issue
Block a user