feat(json-schema-2020-12): add support for boolean JSON Schema

Refs #8513
This commit is contained in:
Vladimir Gorej
2023-04-14 15:59:09 +02:00
committed by Vladimír Gorej
parent 161c5af17d
commit 83ba76c117
11 changed files with 8 additions and 55 deletions

View File

@@ -9,19 +9,19 @@ export const upperFirst = (value) => {
}
export const getTitle = (schema) => {
if (schema.title) return upperFirst(schema.title)
if (schema.$anchor) return upperFirst(schema.$anchor)
if (schema.$id) return schema.$id
if (schema?.title) return upperFirst(schema.title)
if (schema?.$anchor) return upperFirst(schema.$anchor)
if (schema?.$id) return schema.$id
return ""
}
export const getType = (schema) => {
if (Array.isArray(schema.type)) {
if (Array.isArray(schema?.type)) {
return schema.type.map(String).join(" | ")
}
if (schema.type != null) {
if (schema?.type != null) {
return String(schema.type)
}