committed by
Vladimír Gorej
parent
1f1f045b2b
commit
31a1fed11e
@@ -51,6 +51,7 @@ const JSONSchema = ({ schema, name }) => {
|
||||
const KeywordDependentSchemas = useComponent("KeywordDependentSchemas")
|
||||
const KeywordPrefixItems = useComponent("KeywordPrefixItems")
|
||||
const KeywordItems = useComponent("KeywordItems")
|
||||
const KeywordContains = useComponent("KeywordContains")
|
||||
const KeywordProperties = useComponent("KeywordProperties")
|
||||
const KeywordType = useComponent("KeywordType")
|
||||
const KeywordFormat = useComponent("KeywordFormat")
|
||||
@@ -125,6 +126,7 @@ const JSONSchema = ({ schema, name }) => {
|
||||
<KeywordDependentSchemas schema={schema} />
|
||||
<KeywordPrefixItems schema={schema} />
|
||||
<KeywordItems schema={schema} />
|
||||
<KeywordContains schema={schema} />
|
||||
<Keyword$schema schema={schema} />
|
||||
<Keyword$vocabulary schema={schema} />
|
||||
<Keyword$id schema={schema} />
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* @prettier
|
||||
*/
|
||||
import React from "react"
|
||||
|
||||
import { schema } from "../../prop-types"
|
||||
import { useComponent } from "../../hooks"
|
||||
|
||||
const Contains = ({ schema }) => {
|
||||
if (!schema?.contains) return null
|
||||
|
||||
const JSONSchema = useComponent("JSONSchema")
|
||||
const name = (
|
||||
<span className="json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary">
|
||||
Contains
|
||||
</span>
|
||||
)
|
||||
|
||||
return (
|
||||
<div className="json-schema-2020-12-keyword json-schema-2020-12-keyword--contains">
|
||||
<JSONSchema name={name} schema={schema.contains} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Contains.propTypes = {
|
||||
schema: schema.isRequired,
|
||||
}
|
||||
|
||||
export default Contains
|
||||
@@ -143,6 +143,7 @@ export const isExpandable = (schema) => {
|
||||
schema?.dependentSchemas ||
|
||||
schema?.prefixItems ||
|
||||
schema?.items ||
|
||||
schema?.contains ||
|
||||
schema?.description ||
|
||||
schema?.properties
|
||||
)
|
||||
|
||||
@@ -23,6 +23,7 @@ import KeywordElse from "./components/keywords/Else"
|
||||
import KeywordDependentSchemas from "./components/keywords/DependentSchemas"
|
||||
import KeywordPrefixItems from "./components/keywords/PrefixItems"
|
||||
import KeywordItems from "./components/keywords/Items"
|
||||
import KeywordContains from "./components/keywords/Contains"
|
||||
import KeywordProperties from "./components/keywords/Properties/Properties"
|
||||
import KeywordType from "./components/keywords/Type/Type"
|
||||
import KeywordFormat from "./components/keywords/Format/Format"
|
||||
@@ -63,6 +64,7 @@ export const withJSONSchemaContext = (Component, overrides = {}) => {
|
||||
KeywordDependentSchemas,
|
||||
KeywordPrefixItems,
|
||||
KeywordItems,
|
||||
KeywordContains,
|
||||
KeywordProperties,
|
||||
KeywordType,
|
||||
KeywordFormat,
|
||||
|
||||
@@ -22,6 +22,7 @@ import KeywordElse from "./components/keywords/Else"
|
||||
import KeywordDependentSchemas from "./components/keywords/DependentSchemas"
|
||||
import KeywordPrefixItems from "./components/keywords/PrefixItems"
|
||||
import KeywordItems from "./components/keywords/Items"
|
||||
import KeywordContains from "./components/keywords/Contains"
|
||||
import KeywordType from "./components/keywords/Type/Type"
|
||||
import KeywordFormat from "./components/keywords/Format/Format"
|
||||
import KeywordTitle from "./components/keywords/Title/Title"
|
||||
@@ -54,6 +55,7 @@ const JSONSchema202012Plugin = () => ({
|
||||
JSONSchema202012KeywordDependentSchemas: KeywordDependentSchemas,
|
||||
JSONSchema202012KeywordPrefixItems: KeywordPrefixItems,
|
||||
JSONSchema202012KeywordItems: KeywordItems,
|
||||
JSONSchema202012KeywordContains: KeywordContains,
|
||||
JSONSchema202012KeywordProperties: KeywordProperties,
|
||||
JSONSchema202012KeywordType: KeywordType,
|
||||
JSONSchema202012KeywordFormat: KeywordFormat,
|
||||
|
||||
@@ -32,6 +32,7 @@ const ModelsWrapper = createOnlyOAS31ComponentWrapper(({ getSystem }) => {
|
||||
)
|
||||
const KeywordPrefixItems = getComponent("JSONSchema202012KeywordPrefixItems")
|
||||
const KeywordItems = getComponent("JSONSchema202012KeywordItems")
|
||||
const KeywordContains = getComponent("JSONSchema202012KeywordContains")
|
||||
const KeywordProperties = getComponent("JSONSchema202012KeywordProperties")
|
||||
const KeywordType = getComponent("JSONSchema202012KeywordType")
|
||||
const KeywordFormat = getComponent("JSONSchema202012KeywordFormat")
|
||||
@@ -70,6 +71,7 @@ const ModelsWrapper = createOnlyOAS31ComponentWrapper(({ getSystem }) => {
|
||||
KeywordDependentSchemas,
|
||||
KeywordPrefixItems,
|
||||
KeywordItems,
|
||||
KeywordContains,
|
||||
KeywordProperties,
|
||||
KeywordType,
|
||||
KeywordFormat,
|
||||
|
||||
Reference in New Issue
Block a user