committed by
Vladimír Gorej
parent
19f58ef3f3
commit
628f029b3d
@@ -35,6 +35,7 @@ const JSONSchema = ({ schema, name }) => {
|
||||
const Keyword$schema = useComponent("Keyword$schema")
|
||||
const Keyword$vocabulary = useComponent("Keyword$vocabulary")
|
||||
const Keyword$id = useComponent("Keyword$id")
|
||||
const Keyword$anchor = useComponent("Keyword$anchor")
|
||||
const KeywordProperties = useComponent("KeywordProperties")
|
||||
const KeywordType = useComponent("KeywordType")
|
||||
const KeywordFormat = useComponent("KeywordFormat")
|
||||
@@ -101,6 +102,7 @@ const JSONSchema = ({ schema, name }) => {
|
||||
<Keyword$schema schema={schema} />
|
||||
<Keyword$vocabulary schema={schema} />
|
||||
<Keyword$id schema={schema} />
|
||||
<Keyword$anchor schema={schema} />
|
||||
</div>
|
||||
)}
|
||||
</article>
|
||||
|
||||
@@ -55,4 +55,8 @@
|
||||
//}
|
||||
}
|
||||
|
||||
.json-schema-2020-12-core-keyword + .json-schema-2020-12-core-keyword__value::before {
|
||||
content: '='
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* @prettier
|
||||
*/
|
||||
import React from "react"
|
||||
|
||||
import { schema } from "../../prop-types"
|
||||
|
||||
const $anchor = ({ schema }) => {
|
||||
if (!schema?.$anchor) return null
|
||||
|
||||
return (
|
||||
<div className="json-schema-2020-12__$anchor">
|
||||
<span className="json-schema-2020-12-core-keyword">$anchor</span>
|
||||
<span className="json-schema-2020-12-core-keyword__value">
|
||||
{schema.$anchor}
|
||||
</span>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
$anchor.propTypes = {
|
||||
schema: schema.isRequired,
|
||||
}
|
||||
|
||||
export default $anchor
|
||||
@@ -12,7 +12,7 @@ const $id = ({ schema }) => {
|
||||
<div className="json-schema-2020-12__$id">
|
||||
<span className="json-schema-2020-12-core-keyword">$id</span>
|
||||
<span className="json-schema-2020-12-core-keyword__value">
|
||||
={schema.$id}
|
||||
{schema.$id}
|
||||
</span>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -12,7 +12,7 @@ const $schema = ({ schema }) => {
|
||||
<div className="json-schema-2020-12__$schema">
|
||||
<span className="json-schema-2020-12-core-keyword">$schema</span>
|
||||
<span className="json-schema-2020-12-core-keyword__value">
|
||||
={schema.$schema}
|
||||
{schema.$schema}
|
||||
</span>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
border-radius: 4px;
|
||||
text-transform: lowercase;
|
||||
|
||||
&:before {
|
||||
&::before {
|
||||
content: "format: ";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,6 +116,7 @@ export const isExpandable = (schema) => {
|
||||
schema?.$schema ||
|
||||
schema?.$vocabulary ||
|
||||
schema?.$id ||
|
||||
schema?.$anchor ||
|
||||
schema?.description ||
|
||||
schema?.properties
|
||||
)
|
||||
|
||||
@@ -7,6 +7,7 @@ import JSONSchema from "./components/JSONSchema/JSONSchema"
|
||||
import Keyword$schema from "./components/keywords/$schema"
|
||||
import Keyword$vocabulary from "./components/keywords/$vocabulary/$vocabulary"
|
||||
import Keyword$id from "./components/keywords/$id"
|
||||
import Keyword$anchor from "./components/keywords/$anchor"
|
||||
import KeywordProperties from "./components/keywords/Properties"
|
||||
import KeywordType from "./components/keywords/Type/Type"
|
||||
import KeywordFormat from "./components/keywords/Format/Format"
|
||||
@@ -31,6 +32,7 @@ export const withJSONSchemaContext = (Component, overrides = {}) => {
|
||||
Keyword$schema,
|
||||
Keyword$vocabulary,
|
||||
Keyword$id,
|
||||
Keyword$anchor,
|
||||
KeywordProperties,
|
||||
KeywordType,
|
||||
KeywordFormat,
|
||||
|
||||
@@ -6,6 +6,7 @@ import KeywordProperties from "./components/keywords/Properties"
|
||||
import Keyword$schema from "./components/keywords/$schema"
|
||||
import Keyword$vocabulary from "./components/keywords/$vocabulary/$vocabulary"
|
||||
import Keyword$id from "./components/keywords/$id"
|
||||
import Keyword$anchor from "./components/keywords/$anchor"
|
||||
import KeywordType from "./components/keywords/Type/Type"
|
||||
import KeywordFormat from "./components/keywords/Format/Format"
|
||||
import KeywordTitle from "./components/keywords/Title/Title"
|
||||
@@ -22,6 +23,7 @@ const JSONSchema202012Plugin = () => ({
|
||||
JSONSchema202012Keyword$schema: Keyword$schema,
|
||||
JSONSchema202012Keyword$vocabulary: Keyword$vocabulary,
|
||||
JSONSchema202012Keyword$id: Keyword$id,
|
||||
JSONSchema202012Keyword$anchor: Keyword$anchor,
|
||||
JSONSchema202012KeywordProperties: KeywordProperties,
|
||||
JSONSchema202012KeywordType: KeywordType,
|
||||
JSONSchema202012KeywordFormat: KeywordFormat,
|
||||
|
||||
@@ -12,6 +12,7 @@ const ModelsWrapper = createOnlyOAS31ComponentWrapper(({ getSystem }) => {
|
||||
const Keyword$schema = getComponent("JSONSchema202012Keyword$schema")
|
||||
const Keyword$vocabulary = getComponent("JSONSchema202012Keyword$vocabulary")
|
||||
const Keyword$id = getComponent("JSONSchema202012Keyword$id")
|
||||
const Keyword$anchor = getComponent("JSONSchema202012Keyword$anchor")
|
||||
const KeywordProperties = getComponent("JSONSchema202012KeywordProperties")
|
||||
const KeywordType = getComponent("JSONSchema202012KeywordType")
|
||||
const KeywordFormat = getComponent("JSONSchema202012KeywordFormat")
|
||||
@@ -34,6 +35,7 @@ const ModelsWrapper = createOnlyOAS31ComponentWrapper(({ getSystem }) => {
|
||||
Keyword$schema,
|
||||
Keyword$vocabulary,
|
||||
Keyword$id,
|
||||
Keyword$anchor,
|
||||
KeywordProperties,
|
||||
KeywordType,
|
||||
KeywordFormat,
|
||||
|
||||
Reference in New Issue
Block a user