diff --git a/tools/check-openapi b/tools/check-openapi index 6f2f7876ee..9da5ca1bd5 100755 --- a/tools/check-openapi +++ b/tools/check-openapi @@ -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) { diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml index 8a192b9308..69e1592c0e 100644 --- a/zerver/openapi/zulip.yaml +++ b/zerver/openapi/zulip.yaml @@ -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",