feat(json-schema-2020-12): add support for not keyword

Refs #8513
This commit is contained in:
Vladimir Gorej
2023-04-21 09:22:38 +02:00
committed by Vladimír Gorej
parent 15830794f1
commit bf21a4ce3e
10 changed files with 62 additions and 2 deletions

View File

@@ -80,6 +80,10 @@ export const getType = (schema, processedSchemas = new WeakSet()) => {
return null
}
if (schema.not && getType(schema.not) === "any") {
return "never"
}
const typeString = Array.isArray(type)
? type.map((t) => (t === "array" ? getArrayType() : t)).join(" | ")
: type && type.includes("array")
@@ -125,6 +129,7 @@ export const isExpandable = (schema) => {
schema?.allOf ||
schema?.anyOf ||
schema?.oneOf ||
schema?.not ||
schema?.description ||
schema?.properties
)