feat(json-schema-2020-12): add support for boolean JSON Schema
Refs #8513
This commit is contained in:
committed by
Vladimír Gorej
parent
161c5af17d
commit
83ba76c117
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user