committed by
Vladimír Gorej
parent
dea5dbb10e
commit
b7a402398f
@@ -46,6 +46,7 @@ const JSONSchema = ({ schema, name }) => {
|
|||||||
const KeywordOneOf = useComponent("KeywordOneOf")
|
const KeywordOneOf = useComponent("KeywordOneOf")
|
||||||
const KeywordNot = useComponent("KeywordNot")
|
const KeywordNot = useComponent("KeywordNot")
|
||||||
const KeywordIf = useComponent("KeywordIf")
|
const KeywordIf = useComponent("KeywordIf")
|
||||||
|
const KeywordThen = useComponent("KeywordThen")
|
||||||
const KeywordProperties = useComponent("KeywordProperties")
|
const KeywordProperties = useComponent("KeywordProperties")
|
||||||
const KeywordType = useComponent("KeywordType")
|
const KeywordType = useComponent("KeywordType")
|
||||||
const KeywordFormat = useComponent("KeywordFormat")
|
const KeywordFormat = useComponent("KeywordFormat")
|
||||||
@@ -115,6 +116,7 @@ const JSONSchema = ({ schema, name }) => {
|
|||||||
<KeywordOneOf schema={schema} />
|
<KeywordOneOf schema={schema} />
|
||||||
<KeywordNot schema={schema} />
|
<KeywordNot schema={schema} />
|
||||||
<KeywordIf schema={schema} />
|
<KeywordIf schema={schema} />
|
||||||
|
<KeywordThen schema={schema} />
|
||||||
<Keyword$schema schema={schema} />
|
<Keyword$schema schema={schema} />
|
||||||
<Keyword$vocabulary schema={schema} />
|
<Keyword$vocabulary schema={schema} />
|
||||||
<Keyword$id schema={schema} />
|
<Keyword$id schema={schema} />
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
@import './keywords/OneOf/one-of';
|
@import './keywords/OneOf/one-of';
|
||||||
@import './keywords/Not/not';
|
@import './keywords/Not/not';
|
||||||
@import './keywords/If/if';
|
@import './keywords/If/if';
|
||||||
|
@import './keywords/Then/then';
|
||||||
@import './keywords/Type/type';
|
@import './keywords/Type/type';
|
||||||
@import './keywords/Format/format';
|
@import './keywords/Format/format';
|
||||||
@import './keywords/Description/description';
|
@import './keywords/Description/description';
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
/**
|
||||||
|
* @prettier
|
||||||
|
*/
|
||||||
|
import React from "react"
|
||||||
|
|
||||||
|
import { schema } from "../../../prop-types"
|
||||||
|
import { useComponent } from "../../../hooks"
|
||||||
|
|
||||||
|
const Then = ({ schema }) => {
|
||||||
|
if (!schema?.then) return null
|
||||||
|
|
||||||
|
const JSONSchema = useComponent("JSONSchema")
|
||||||
|
const name = (
|
||||||
|
<span className="json-schema-2020-12-core-keyword json-schema-2020-12-core-keyword--then">
|
||||||
|
Then
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="json-schema-2020-12__then">
|
||||||
|
<JSONSchema name={name} schema={schema.then} />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
Then.propTypes = {
|
||||||
|
schema: schema.isRequired,
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Then
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
.json-schema-2020-12 {
|
||||||
|
&__then {
|
||||||
|
.json-schema-2020-12-core-keyword--then {
|
||||||
|
@extend .json-schema-2020-12-core-keyword--allOf;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -131,6 +131,7 @@ export const isExpandable = (schema) => {
|
|||||||
schema?.oneOf ||
|
schema?.oneOf ||
|
||||||
schema?.not ||
|
schema?.not ||
|
||||||
schema?.if ||
|
schema?.if ||
|
||||||
|
schema?.then ||
|
||||||
schema?.description ||
|
schema?.description ||
|
||||||
schema?.properties
|
schema?.properties
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import KeywordAnyOf from "./components/keywords/AnyOf/AnyOf"
|
|||||||
import KeywordOneOf from "./components/keywords/OneOf/OneOf"
|
import KeywordOneOf from "./components/keywords/OneOf/OneOf"
|
||||||
import KeywordNot from "./components/keywords/Not/Not"
|
import KeywordNot from "./components/keywords/Not/Not"
|
||||||
import KeywordIf from "./components/keywords/If/If"
|
import KeywordIf from "./components/keywords/If/If"
|
||||||
|
import KeywordThen from "./components/keywords/Then/Then"
|
||||||
import KeywordProperties from "./components/keywords/Properties/Properties"
|
import KeywordProperties from "./components/keywords/Properties/Properties"
|
||||||
import KeywordType from "./components/keywords/Type/Type"
|
import KeywordType from "./components/keywords/Type/Type"
|
||||||
import KeywordFormat from "./components/keywords/Format/Format"
|
import KeywordFormat from "./components/keywords/Format/Format"
|
||||||
@@ -53,6 +54,7 @@ export const withJSONSchemaContext = (Component, overrides = {}) => {
|
|||||||
KeywordOneOf,
|
KeywordOneOf,
|
||||||
KeywordNot,
|
KeywordNot,
|
||||||
KeywordIf,
|
KeywordIf,
|
||||||
|
KeywordThen,
|
||||||
KeywordProperties,
|
KeywordProperties,
|
||||||
KeywordType,
|
KeywordType,
|
||||||
KeywordFormat,
|
KeywordFormat,
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import KeywordAnyOf from "./components/keywords/AnyOf/AnyOf"
|
|||||||
import KeywordOneOf from "./components/keywords/OneOf/OneOf"
|
import KeywordOneOf from "./components/keywords/OneOf/OneOf"
|
||||||
import KeywordNot from "./components/keywords/Not/Not"
|
import KeywordNot from "./components/keywords/Not/Not"
|
||||||
import KeywordIf from "./components/keywords/If/If"
|
import KeywordIf from "./components/keywords/If/If"
|
||||||
|
import KeywordThen from "./components/keywords/Then/Then"
|
||||||
import KeywordType from "./components/keywords/Type/Type"
|
import KeywordType from "./components/keywords/Type/Type"
|
||||||
import KeywordFormat from "./components/keywords/Format/Format"
|
import KeywordFormat from "./components/keywords/Format/Format"
|
||||||
import KeywordTitle from "./components/keywords/Title/Title"
|
import KeywordTitle from "./components/keywords/Title/Title"
|
||||||
@@ -44,6 +45,7 @@ const JSONSchema202012Plugin = () => ({
|
|||||||
JSONSchema202012KeywordOneOf: KeywordOneOf,
|
JSONSchema202012KeywordOneOf: KeywordOneOf,
|
||||||
JSONSchema202012KeywordNot: KeywordNot,
|
JSONSchema202012KeywordNot: KeywordNot,
|
||||||
JSONSchema202012KeywordIf: KeywordIf,
|
JSONSchema202012KeywordIf: KeywordIf,
|
||||||
|
JSONSchema202012KeywordThen: KeywordThen,
|
||||||
JSONSchema202012KeywordProperties: KeywordProperties,
|
JSONSchema202012KeywordProperties: KeywordProperties,
|
||||||
JSONSchema202012KeywordType: KeywordType,
|
JSONSchema202012KeywordType: KeywordType,
|
||||||
JSONSchema202012KeywordFormat: KeywordFormat,
|
JSONSchema202012KeywordFormat: KeywordFormat,
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ const ModelsWrapper = createOnlyOAS31ComponentWrapper(({ getSystem }) => {
|
|||||||
const KeywordOneOf = getComponent("JSONSchema202012KeywordOneOf")
|
const KeywordOneOf = getComponent("JSONSchema202012KeywordOneOf")
|
||||||
const KeywordNot = getComponent("JSONSchema202012KeywordNot")
|
const KeywordNot = getComponent("JSONSchema202012KeywordNot")
|
||||||
const KeywordIf = getComponent("JSONSchema202012KeywordIf")
|
const KeywordIf = getComponent("JSONSchema202012KeywordIf")
|
||||||
|
const KeywordThen = getComponent("JSONSchema202012KeywordThen")
|
||||||
const KeywordProperties = getComponent("JSONSchema202012KeywordProperties")
|
const KeywordProperties = getComponent("JSONSchema202012KeywordProperties")
|
||||||
const KeywordType = getComponent("JSONSchema202012KeywordType")
|
const KeywordType = getComponent("JSONSchema202012KeywordType")
|
||||||
const KeywordFormat = getComponent("JSONSchema202012KeywordFormat")
|
const KeywordFormat = getComponent("JSONSchema202012KeywordFormat")
|
||||||
@@ -58,6 +59,7 @@ const ModelsWrapper = createOnlyOAS31ComponentWrapper(({ getSystem }) => {
|
|||||||
KeywordOneOf,
|
KeywordOneOf,
|
||||||
KeywordNot,
|
KeywordNot,
|
||||||
KeywordIf,
|
KeywordIf,
|
||||||
|
KeywordThen,
|
||||||
KeywordProperties,
|
KeywordProperties,
|
||||||
KeywordType,
|
KeywordType,
|
||||||
KeywordFormat,
|
KeywordFormat,
|
||||||
|
|||||||
Reference in New Issue
Block a user