feat(json-schema-2020-12): detect expandable behavior

Refs #8513
This commit is contained in:
Vladimir Gorej
2023-04-19 09:40:59 +02:00
committed by Vladimír Gorej
parent e517397fd2
commit fe181ede90
7 changed files with 48 additions and 17 deletions

View File

@@ -63,7 +63,7 @@ export const getType = (schema, processedSchemas = new WeakSet()) => {
schema.exclusiveMaximum ||
schema.multipleOf
) {
return "number|integer"
return "number | integer"
} else if (schema.const !== undefined) {
if (schema.const === null) {
return "null"
@@ -110,3 +110,7 @@ export const getType = (schema, processedSchemas = new WeakSet()) => {
}
export const isBooleanJSONSchema = (schema) => typeof schema === "boolean"
export const isExpandable = (schema) => {
return schema?.description || schema?.properties
}