committed by
Vladimír Gorej
parent
b7a402398f
commit
503aa19f36
@@ -47,6 +47,7 @@ const JSONSchema = ({ schema, name }) => {
|
|||||||
const KeywordNot = useComponent("KeywordNot")
|
const KeywordNot = useComponent("KeywordNot")
|
||||||
const KeywordIf = useComponent("KeywordIf")
|
const KeywordIf = useComponent("KeywordIf")
|
||||||
const KeywordThen = useComponent("KeywordThen")
|
const KeywordThen = useComponent("KeywordThen")
|
||||||
|
const KeywordElse = useComponent("KeywordElse")
|
||||||
const KeywordProperties = useComponent("KeywordProperties")
|
const KeywordProperties = useComponent("KeywordProperties")
|
||||||
const KeywordType = useComponent("KeywordType")
|
const KeywordType = useComponent("KeywordType")
|
||||||
const KeywordFormat = useComponent("KeywordFormat")
|
const KeywordFormat = useComponent("KeywordFormat")
|
||||||
@@ -117,6 +118,7 @@ const JSONSchema = ({ schema, name }) => {
|
|||||||
<KeywordNot schema={schema} />
|
<KeywordNot schema={schema} />
|
||||||
<KeywordIf schema={schema} />
|
<KeywordIf schema={schema} />
|
||||||
<KeywordThen schema={schema} />
|
<KeywordThen schema={schema} />
|
||||||
|
<KeywordElse 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} />
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
@import './keywords/Not/not';
|
@import './keywords/Not/not';
|
||||||
@import './keywords/If/if';
|
@import './keywords/If/if';
|
||||||
@import './keywords/Then/then';
|
@import './keywords/Then/then';
|
||||||
|
@import './keywords/Else/else';
|
||||||
@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 Else = ({ schema }) => {
|
||||||
|
if (!schema?.else) return null
|
||||||
|
|
||||||
|
const JSONSchema = useComponent("JSONSchema")
|
||||||
|
const name = (
|
||||||
|
<span className="json-schema-2020-12-core-keyword json-schema-2020-12-core-keyword--else">
|
||||||
|
Else
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="json-schema-2020-12__else">
|
||||||
|
<JSONSchema name={name} schema={schema.else} />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
Else.propTypes = {
|
||||||
|
schema: schema.isRequired,
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Else
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
.json-schema-2020-12 {
|
||||||
|
&__else {
|
||||||
|
.json-schema-2020-12-core-keyword--else {
|
||||||
|
@extend .json-schema-2020-12-core-keyword--allOf;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -132,6 +132,7 @@ export const isExpandable = (schema) => {
|
|||||||
schema?.not ||
|
schema?.not ||
|
||||||
schema?.if ||
|
schema?.if ||
|
||||||
schema?.then ||
|
schema?.then ||
|
||||||
|
schema?.else ||
|
||||||
schema?.description ||
|
schema?.description ||
|
||||||
schema?.properties
|
schema?.properties
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ 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 KeywordThen from "./components/keywords/Then/Then"
|
||||||
|
import KeywordElse from "./components/keywords/Else/Else"
|
||||||
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"
|
||||||
@@ -55,6 +56,7 @@ export const withJSONSchemaContext = (Component, overrides = {}) => {
|
|||||||
KeywordNot,
|
KeywordNot,
|
||||||
KeywordIf,
|
KeywordIf,
|
||||||
KeywordThen,
|
KeywordThen,
|
||||||
|
KeywordElse,
|
||||||
KeywordProperties,
|
KeywordProperties,
|
||||||
KeywordType,
|
KeywordType,
|
||||||
KeywordFormat,
|
KeywordFormat,
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ 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 KeywordThen from "./components/keywords/Then/Then"
|
||||||
|
import KeywordElse from "./components/keywords/Else/Else"
|
||||||
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"
|
||||||
@@ -46,6 +47,7 @@ const JSONSchema202012Plugin = () => ({
|
|||||||
JSONSchema202012KeywordNot: KeywordNot,
|
JSONSchema202012KeywordNot: KeywordNot,
|
||||||
JSONSchema202012KeywordIf: KeywordIf,
|
JSONSchema202012KeywordIf: KeywordIf,
|
||||||
JSONSchema202012KeywordThen: KeywordThen,
|
JSONSchema202012KeywordThen: KeywordThen,
|
||||||
|
JSONSchema202012KeywordElse: KeywordElse,
|
||||||
JSONSchema202012KeywordProperties: KeywordProperties,
|
JSONSchema202012KeywordProperties: KeywordProperties,
|
||||||
JSONSchema202012KeywordType: KeywordType,
|
JSONSchema202012KeywordType: KeywordType,
|
||||||
JSONSchema202012KeywordFormat: KeywordFormat,
|
JSONSchema202012KeywordFormat: KeywordFormat,
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ const ModelsWrapper = createOnlyOAS31ComponentWrapper(({ getSystem }) => {
|
|||||||
const KeywordNot = getComponent("JSONSchema202012KeywordNot")
|
const KeywordNot = getComponent("JSONSchema202012KeywordNot")
|
||||||
const KeywordIf = getComponent("JSONSchema202012KeywordIf")
|
const KeywordIf = getComponent("JSONSchema202012KeywordIf")
|
||||||
const KeywordThen = getComponent("JSONSchema202012KeywordThen")
|
const KeywordThen = getComponent("JSONSchema202012KeywordThen")
|
||||||
|
const KeywordElse = getComponent("JSONSchema202012KeywordElse")
|
||||||
const KeywordProperties = getComponent("JSONSchema202012KeywordProperties")
|
const KeywordProperties = getComponent("JSONSchema202012KeywordProperties")
|
||||||
const KeywordType = getComponent("JSONSchema202012KeywordType")
|
const KeywordType = getComponent("JSONSchema202012KeywordType")
|
||||||
const KeywordFormat = getComponent("JSONSchema202012KeywordFormat")
|
const KeywordFormat = getComponent("JSONSchema202012KeywordFormat")
|
||||||
@@ -60,6 +61,7 @@ const ModelsWrapper = createOnlyOAS31ComponentWrapper(({ getSystem }) => {
|
|||||||
KeywordNot,
|
KeywordNot,
|
||||||
KeywordIf,
|
KeywordIf,
|
||||||
KeywordThen,
|
KeywordThen,
|
||||||
|
KeywordElse,
|
||||||
KeywordProperties,
|
KeywordProperties,
|
||||||
KeywordType,
|
KeywordType,
|
||||||
KeywordFormat,
|
KeywordFormat,
|
||||||
|
|||||||
Reference in New Issue
Block a user