fix(json-schema-2020-12): fix rendering of items keywords (#8674)
As JSON Schema 2020-12 can be represented as a Boolean Schema, different keyword detection needs to be used. Refs #8513
This commit is contained in:
@@ -4,15 +4,16 @@
|
||||
import React from "react"
|
||||
|
||||
import { schema } from "../../prop-types"
|
||||
import { useComponent } from "../../hooks"
|
||||
import { useFn, useComponent } from "../../hooks"
|
||||
|
||||
const Items = ({ schema }) => {
|
||||
const fn = useFn()
|
||||
const JSONSchema = useComponent("JSONSchema")
|
||||
|
||||
/**
|
||||
* Rendering.
|
||||
*/
|
||||
if (!schema?.items) return null
|
||||
if (!fn.hasKeyword(schema, "items")) return null
|
||||
|
||||
const name = (
|
||||
<span className="json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary">
|
||||
|
||||
@@ -151,7 +151,7 @@ export const isExpandable = (schema) => {
|
||||
fn.hasKeyword(schema, "else") ||
|
||||
schema?.dependentSchemas ||
|
||||
schema?.prefixItems ||
|
||||
schema?.items ||
|
||||
fn.hasKeyword(schema, "items") ||
|
||||
fn.hasKeyword(schema, "contains") ||
|
||||
schema?.properties ||
|
||||
schema?.patternProperties ||
|
||||
|
||||
Reference in New Issue
Block a user