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 React from "react"
|
||||||
|
|
||||||
import { schema } from "../../prop-types"
|
import { schema } from "../../prop-types"
|
||||||
import { useComponent } from "../../hooks"
|
import { useFn, useComponent } from "../../hooks"
|
||||||
|
|
||||||
const Items = ({ schema }) => {
|
const Items = ({ schema }) => {
|
||||||
|
const fn = useFn()
|
||||||
const JSONSchema = useComponent("JSONSchema")
|
const JSONSchema = useComponent("JSONSchema")
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Rendering.
|
* Rendering.
|
||||||
*/
|
*/
|
||||||
if (!schema?.items) return null
|
if (!fn.hasKeyword(schema, "items")) return null
|
||||||
|
|
||||||
const name = (
|
const name = (
|
||||||
<span className="json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary">
|
<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") ||
|
fn.hasKeyword(schema, "else") ||
|
||||||
schema?.dependentSchemas ||
|
schema?.dependentSchemas ||
|
||||||
schema?.prefixItems ||
|
schema?.prefixItems ||
|
||||||
schema?.items ||
|
fn.hasKeyword(schema, "items") ||
|
||||||
fn.hasKeyword(schema, "contains") ||
|
fn.hasKeyword(schema, "contains") ||
|
||||||
schema?.properties ||
|
schema?.properties ||
|
||||||
schema?.patternProperties ||
|
schema?.patternProperties ||
|
||||||
|
|||||||
Reference in New Issue
Block a user