diff --git a/src/core/plugins/json-schema-2020-12/components/JSONSchema/JSONSchema.jsx b/src/core/plugins/json-schema-2020-12/components/JSONSchema/JSONSchema.jsx
index a896c2e85e0..47cc8189133 100644
--- a/src/core/plugins/json-schema-2020-12/components/JSONSchema/JSONSchema.jsx
+++ b/src/core/plugins/json-schema-2020-12/components/JSONSchema/JSONSchema.jsx
@@ -44,6 +44,7 @@ const JSONSchema = ({ schema, name }) => {
const KeywordAllOf = useComponent("KeywordAllOf")
const KeywordAnyOf = useComponent("KeywordAnyOf")
const KeywordOneOf = useComponent("KeywordOneOf")
+ const KeywordNot = useComponent("KeywordNot")
const KeywordProperties = useComponent("KeywordProperties")
const KeywordType = useComponent("KeywordType")
const KeywordFormat = useComponent("KeywordFormat")
@@ -111,6 +112,7 @@ const JSONSchema = ({ schema, name }) => {
+
@@ -132,7 +134,7 @@ const JSONSchema = ({ schema, name }) => {
}
JSONSchema.propTypes = {
- name: PropTypes.string,
+ name: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
schema: propTypes.schema.isRequired,
}
diff --git a/src/core/plugins/json-schema-2020-12/components/_all.scss b/src/core/plugins/json-schema-2020-12/components/_all.scss
index 70f85af5045..84689518a68 100644
--- a/src/core/plugins/json-schema-2020-12/components/_all.scss
+++ b/src/core/plugins/json-schema-2020-12/components/_all.scss
@@ -11,6 +11,7 @@
@import './keywords/AllOf/all-of';
@import './keywords/AnyOf/any-of';
@import './keywords/OneOf/one-of';
+@import './keywords/Not/not';
@import './keywords/Type/type';
@import './keywords/Format/format';
@import './keywords/Description/description';
diff --git a/src/core/plugins/json-schema-2020-12/components/keywords/Not/Not.jsx b/src/core/plugins/json-schema-2020-12/components/keywords/Not/Not.jsx
new file mode 100644
index 00000000000..27f2a173a8d
--- /dev/null
+++ b/src/core/plugins/json-schema-2020-12/components/keywords/Not/Not.jsx
@@ -0,0 +1,30 @@
+/**
+ * @prettier
+ */
+import React from "react"
+
+import { schema } from "../../../prop-types"
+import { useComponent } from "../../../hooks"
+
+const Not = ({ schema }) => {
+ if (!schema?.not) return null
+
+ const JSONSchema = useComponent("JSONSchema")
+ const name = (
+
+ Not
+
+ )
+
+ return (
+
+
+
+ )
+}
+
+Not.propTypes = {
+ schema: schema.isRequired,
+}
+
+export default Not
diff --git a/src/core/plugins/json-schema-2020-12/components/keywords/Not/_not.scss b/src/core/plugins/json-schema-2020-12/components/keywords/Not/_not.scss
new file mode 100644
index 00000000000..35c5a35fdcc
--- /dev/null
+++ b/src/core/plugins/json-schema-2020-12/components/keywords/Not/_not.scss
@@ -0,0 +1,10 @@
+.json-schema-2020-12 {
+ &__not {
+ .json-schema-2020-12-core-keyword--not {
+ @extend .json-schema-2020-12-core-keyword--allOf;
+ }
+ }
+}
+
+
+
diff --git a/src/core/plugins/json-schema-2020-12/components/keywords/Title/Title.jsx b/src/core/plugins/json-schema-2020-12/components/keywords/Title/Title.jsx
index 0ad3e639990..2e94c38ef85 100644
--- a/src/core/plugins/json-schema-2020-12/components/keywords/Title/Title.jsx
+++ b/src/core/plugins/json-schema-2020-12/components/keywords/Title/Title.jsx
@@ -18,7 +18,7 @@ const Title = ({ title, schema }) => {
}
Title.propTypes = {
- title: PropTypes.string,
+ title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
schema: schema.isRequired,
}
diff --git a/src/core/plugins/json-schema-2020-12/components/keywords/Title/_title.scss b/src/core/plugins/json-schema-2020-12/components/keywords/Title/_title.scss
index e4499aa31d5..1b8828fdb6d 100644
--- a/src/core/plugins/json-schema-2020-12/components/keywords/Title/_title.scss
+++ b/src/core/plugins/json-schema-2020-12/components/keywords/Title/_title.scss
@@ -3,8 +3,14 @@
@include text_headline($section-models-model-title-font-color);
display: inline-block;
font-weight: bold;
+
+ & .json-schema-2020-12-core-keyword {
+ margin: 0;
+ }
}
+
+
&-property {
margin: 7px 0;
diff --git a/src/core/plugins/json-schema-2020-12/fn.js b/src/core/plugins/json-schema-2020-12/fn.js
index 0b9d8533c02..1b2ce4ed6f1 100644
--- a/src/core/plugins/json-schema-2020-12/fn.js
+++ b/src/core/plugins/json-schema-2020-12/fn.js
@@ -80,6 +80,10 @@ export const getType = (schema, processedSchemas = new WeakSet()) => {
return null
}
+ if (schema.not && getType(schema.not) === "any") {
+ return "never"
+ }
+
const typeString = Array.isArray(type)
? type.map((t) => (t === "array" ? getArrayType() : t)).join(" | ")
: type && type.includes("array")
@@ -125,6 +129,7 @@ export const isExpandable = (schema) => {
schema?.allOf ||
schema?.anyOf ||
schema?.oneOf ||
+ schema?.not ||
schema?.description ||
schema?.properties
)
diff --git a/src/core/plugins/json-schema-2020-12/hoc.jsx b/src/core/plugins/json-schema-2020-12/hoc.jsx
index e788a14c5c7..8ee4b6f4155 100644
--- a/src/core/plugins/json-schema-2020-12/hoc.jsx
+++ b/src/core/plugins/json-schema-2020-12/hoc.jsx
@@ -16,6 +16,7 @@ import Keyword$comment from "./components/keywords/$comment"
import KeywordAllOf from "./components/keywords/AllOf/AllOf"
import KeywordAnyOf from "./components/keywords/AnyOf/AnyOf"
import KeywordOneOf from "./components/keywords/OneOf/OneOf"
+import KeywordNot from "./components/keywords/Not/Not"
import KeywordProperties from "./components/keywords/Properties/Properties"
import KeywordType from "./components/keywords/Type/Type"
import KeywordFormat from "./components/keywords/Format/Format"
@@ -49,6 +50,7 @@ export const withJSONSchemaContext = (Component, overrides = {}) => {
KeywordAllOf,
KeywordAnyOf,
KeywordOneOf,
+ KeywordNot,
KeywordProperties,
KeywordType,
KeywordFormat,
diff --git a/src/core/plugins/json-schema-2020-12/index.js b/src/core/plugins/json-schema-2020-12/index.js
index 74c8b4fe7eb..20c6e659045 100644
--- a/src/core/plugins/json-schema-2020-12/index.js
+++ b/src/core/plugins/json-schema-2020-12/index.js
@@ -15,6 +15,7 @@ import Keyword$comment from "./components/keywords/$comment"
import KeywordAllOf from "./components/keywords/AllOf/AllOf"
import KeywordAnyOf from "./components/keywords/AnyOf/AnyOf"
import KeywordOneOf from "./components/keywords/OneOf/OneOf"
+import KeywordNot from "./components/keywords/Not/Not"
import KeywordType from "./components/keywords/Type/Type"
import KeywordFormat from "./components/keywords/Format/Format"
import KeywordTitle from "./components/keywords/Title/Title"
@@ -40,6 +41,7 @@ const JSONSchema202012Plugin = () => ({
JSONSchema202012KeywordAllOf: KeywordAllOf,
JSONSchema202012KeywordAnyOf: KeywordAnyOf,
JSONSchema202012KeywordOneOf: KeywordOneOf,
+ JSONSchema202012KeywordNot: KeywordNot,
JSONSchema202012KeywordProperties: KeywordProperties,
JSONSchema202012KeywordType: KeywordType,
JSONSchema202012KeywordFormat: KeywordFormat,
diff --git a/src/core/plugins/oas31/wrap-components/models.jsx b/src/core/plugins/oas31/wrap-components/models.jsx
index 01b86677b5d..864bb748abd 100644
--- a/src/core/plugins/oas31/wrap-components/models.jsx
+++ b/src/core/plugins/oas31/wrap-components/models.jsx
@@ -23,6 +23,7 @@ const ModelsWrapper = createOnlyOAS31ComponentWrapper(({ getSystem }) => {
const KeywordAllOf = getComponent("JSONSchema202012KeywordAllOf")
const KeywordAnyOf = getComponent("JSONSchema202012KeywordAnyOf")
const KeywordOneOf = getComponent("JSONSchema202012KeywordOneOf")
+ const KeywordNot = getComponent("JSONSchema202012KeywordNot")
const KeywordProperties = getComponent("JSONSchema202012KeywordProperties")
const KeywordType = getComponent("JSONSchema202012KeywordType")
const KeywordFormat = getComponent("JSONSchema202012KeywordFormat")
@@ -54,6 +55,7 @@ const ModelsWrapper = createOnlyOAS31ComponentWrapper(({ getSystem }) => {
KeywordAllOf,
KeywordAnyOf,
KeywordOneOf,
+ KeywordNot,
KeywordProperties,
KeywordType,
KeywordFormat,