committed by
Vladimír Gorej
parent
daa0506163
commit
2f08f6424b
@@ -40,6 +40,7 @@ const JSONSchema = ({ schema, name }) => {
|
||||
const Keyword$ref = useComponent("Keyword$ref")
|
||||
const Keyword$dynamicRef = useComponent("Keyword$dynamicRef")
|
||||
const Keyword$defs = useComponent("Keyword$defs")
|
||||
const Keyword$comment = useComponent("Keyword$comment")
|
||||
const KeywordProperties = useComponent("KeywordProperties")
|
||||
const KeywordType = useComponent("KeywordType")
|
||||
const KeywordFormat = useComponent("KeywordFormat")
|
||||
@@ -111,6 +112,7 @@ const JSONSchema = ({ schema, name }) => {
|
||||
<Keyword$ref schema={schema} />
|
||||
<Keyword$dynamicRef schema={schema} />
|
||||
<Keyword$defs schema={schema} />
|
||||
<Keyword$comment schema={schema} />
|
||||
</div>
|
||||
)}
|
||||
</article>
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* @prettier
|
||||
*/
|
||||
import React from "react"
|
||||
|
||||
import { schema } from "../../prop-types"
|
||||
|
||||
const $comment = ({ schema }) => {
|
||||
if (!schema?.$comment) return null
|
||||
|
||||
return (
|
||||
<div className="json-schema-2020-12__$comment">
|
||||
<span className="json-schema-2020-12-core-keyword">$comment</span>
|
||||
<span className="json-schema-2020-12-core-keyword__value">
|
||||
{schema.$comment}
|
||||
</span>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
$comment.propTypes = {
|
||||
schema: schema.isRequired,
|
||||
}
|
||||
|
||||
export default $comment
|
||||
@@ -121,6 +121,7 @@ export const isExpandable = (schema) => {
|
||||
schema?.$ref ||
|
||||
schema?.$dynamicRef ||
|
||||
schema?.$defs ||
|
||||
schema?.$comment ||
|
||||
schema?.description ||
|
||||
schema?.properties
|
||||
)
|
||||
|
||||
@@ -12,6 +12,7 @@ import Keyword$dynamicAnchor from "./components/keywords/$dynamicAnchor"
|
||||
import Keyword$ref from "./components/keywords/$ref"
|
||||
import Keyword$dynamicRef from "./components/keywords/$dynamicRef"
|
||||
import Keyword$defs from "./components/keywords/$defs/$defs"
|
||||
import Keyword$comment from "./components/keywords/$comment"
|
||||
import KeywordProperties from "./components/keywords/Properties/Properties"
|
||||
import KeywordType from "./components/keywords/Type/Type"
|
||||
import KeywordFormat from "./components/keywords/Format/Format"
|
||||
@@ -41,6 +42,7 @@ export const withJSONSchemaContext = (Component, overrides = {}) => {
|
||||
Keyword$ref,
|
||||
Keyword$dynamicRef,
|
||||
Keyword$defs,
|
||||
Keyword$comment,
|
||||
KeywordProperties,
|
||||
KeywordType,
|
||||
KeywordFormat,
|
||||
|
||||
@@ -11,6 +11,7 @@ import Keyword$dynamicAnchor from "./components/keywords/$dynamicAnchor"
|
||||
import Keyword$ref from "./components/keywords/$ref"
|
||||
import Keyword$dynamicRef from "./components/keywords/$dynamicRef"
|
||||
import Keyword$defs from "./components/keywords/$defs/$defs"
|
||||
import Keyword$comment from "./components/keywords/$comment"
|
||||
import KeywordType from "./components/keywords/Type/Type"
|
||||
import KeywordFormat from "./components/keywords/Format/Format"
|
||||
import KeywordTitle from "./components/keywords/Title/Title"
|
||||
@@ -32,6 +33,7 @@ const JSONSchema202012Plugin = () => ({
|
||||
JSONSchema202012Keyword$ref: Keyword$ref,
|
||||
JSONSchema202012Keyword$dynamicRef: Keyword$dynamicRef,
|
||||
JSONSchema202012Keyword$defs: Keyword$defs,
|
||||
JSONSchema202012Keyword$comment: Keyword$comment,
|
||||
JSONSchema202012KeywordProperties: KeywordProperties,
|
||||
JSONSchema202012KeywordType: KeywordType,
|
||||
JSONSchema202012KeywordFormat: KeywordFormat,
|
||||
|
||||
@@ -19,6 +19,7 @@ const ModelsWrapper = createOnlyOAS31ComponentWrapper(({ getSystem }) => {
|
||||
const Keyword$ref = getComponent("JSONSchema202012Keyword$ref")
|
||||
const Keyword$dynamicRef = getComponent("JSONSchema202012Keyword$dynamicRef")
|
||||
const Keyword$defs = getComponent("JSONSchema202012Keyword$defs")
|
||||
const Keyword$comment = getComponent("JSONSchema202012Keyword$comment")
|
||||
const KeywordProperties = getComponent("JSONSchema202012KeywordProperties")
|
||||
const KeywordType = getComponent("JSONSchema202012KeywordType")
|
||||
const KeywordFormat = getComponent("JSONSchema202012KeywordFormat")
|
||||
@@ -46,6 +47,7 @@ const ModelsWrapper = createOnlyOAS31ComponentWrapper(({ getSystem }) => {
|
||||
Keyword$ref,
|
||||
Keyword$dynamicRef,
|
||||
Keyword$defs,
|
||||
Keyword$comment,
|
||||
KeywordProperties,
|
||||
KeywordType,
|
||||
KeywordFormat,
|
||||
|
||||
Reference in New Issue
Block a user