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 6f3037f6..40883087 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
@@ -75,6 +75,7 @@ const JSONSchema = forwardRef(
const KeywordDefault = useComponent("KeywordDefault")
const KeywordDeprecated = useComponent("KeywordDeprecated")
const KeywordReadOnly = useComponent("KeywordReadOnly")
+ const KeywordWriteOnly = useComponent("KeywordWriteOnly")
const ExpandDeepButton = useComponent("ExpandDeepButton")
/**
@@ -136,6 +137,7 @@ const JSONSchema = forwardRef(
)}
+
{constraints.length > 0 &&
constraints.map((constraint) => (
diff --git a/src/core/plugins/json-schema-2020-12/components/keywords/ReadOnly/ReadOnly.jsx b/src/core/plugins/json-schema-2020-12/components/keywords/ReadOnly/ReadOnly.jsx
index ca970618..92118a01 100644
--- a/src/core/plugins/json-schema-2020-12/components/keywords/ReadOnly/ReadOnly.jsx
+++ b/src/core/plugins/json-schema-2020-12/components/keywords/ReadOnly/ReadOnly.jsx
@@ -8,7 +8,7 @@ import { schema } from "../../../prop-types"
const ReadOnly = ({ schema }) => {
if (schema?.readOnly !== true) return null
- return read-only
+ return read-only
}
ReadOnly.propTypes = {
diff --git a/src/core/plugins/json-schema-2020-12/components/keywords/ReadOnly/_read-only.scss b/src/core/plugins/json-schema-2020-12/components/keywords/ReadOnly/_read-only.scss
index 36ce41dd..aa4130c2 100644
--- a/src/core/plugins/json-schema-2020-12/components/keywords/ReadOnly/_read-only.scss
+++ b/src/core/plugins/json-schema-2020-12/components/keywords/ReadOnly/_read-only.scss
@@ -1,5 +1,5 @@
.json-schema-2020-12 {
- &__readonly {
+ &__readOnly {
@extend .json-schema-2020-12__deprecated;
color: gray;
}
diff --git a/src/core/plugins/json-schema-2020-12/components/keywords/WriteOnly/WriteOnly.jsx b/src/core/plugins/json-schema-2020-12/components/keywords/WriteOnly/WriteOnly.jsx
new file mode 100644
index 00000000..bc5dd568
--- /dev/null
+++ b/src/core/plugins/json-schema-2020-12/components/keywords/WriteOnly/WriteOnly.jsx
@@ -0,0 +1,18 @@
+/**
+ * @prettier
+ */
+import React from "react"
+
+import { schema } from "../../../prop-types"
+
+const WriteOnly = ({ schema }) => {
+ if (schema?.writeOnly !== true) return null
+
+ return write-only
+}
+
+WriteOnly.propTypes = {
+ schema: schema.isRequired,
+}
+
+export default WriteOnly
diff --git a/src/core/plugins/json-schema-2020-12/components/keywords/WriteOnly/_write-only.scss b/src/core/plugins/json-schema-2020-12/components/keywords/WriteOnly/_write-only.scss
new file mode 100644
index 00000000..461f2dbf
--- /dev/null
+++ b/src/core/plugins/json-schema-2020-12/components/keywords/WriteOnly/_write-only.scss
@@ -0,0 +1,5 @@
+.json-schema-2020-12 {
+ &__writeOnly {
+ @extend .json-schema-2020-12__readOnly;
+ }
+}
diff --git a/src/core/plugins/json-schema-2020-12/components/keywords/_all.scss b/src/core/plugins/json-schema-2020-12/components/keywords/_all.scss
index 529f5912..78aa7094 100644
--- a/src/core/plugins/json-schema-2020-12/components/keywords/_all.scss
+++ b/src/core/plugins/json-schema-2020-12/components/keywords/_all.scss
@@ -76,3 +76,4 @@
@import './DependentRequired/dependent-required';
@import './Deprecated/deprecated';
@import './ReadOnly/read-only';
+@import './WriteOnly/write-only';
diff --git a/src/core/plugins/json-schema-2020-12/hoc.jsx b/src/core/plugins/json-schema-2020-12/hoc.jsx
index fca017b8..cfd4d73b 100644
--- a/src/core/plugins/json-schema-2020-12/hoc.jsx
+++ b/src/core/plugins/json-schema-2020-12/hoc.jsx
@@ -41,6 +41,7 @@ import KeywordDescription from "./components/keywords/Description/Description"
import KeywordDefault from "./components/keywords/Default"
import KeywordDeprecated from "./components/keywords/Deprecated/Deprecated"
import KeywordReadOnly from "./components/keywords/ReadOnly/ReadOnly"
+import KeywordWriteOnly from "./components/keywords/WriteOnly/WriteOnly"
import Accordion from "./components/Accordion/Accordion"
import ExpandDeepButton from "./components/ExpandDeepButton/ExpandDeepButton"
import ChevronRightIcon from "./components/icons/ChevronRight"
@@ -98,6 +99,7 @@ export const withJSONSchemaContext = (Component, overrides = {}) => {
KeywordDefault,
KeywordDeprecated,
KeywordReadOnly,
+ KeywordWriteOnly,
Accordion,
ExpandDeepButton,
ChevronRightIcon,
diff --git a/src/core/plugins/json-schema-2020-12/index.js b/src/core/plugins/json-schema-2020-12/index.js
index 3860ed71..983eacc1 100644
--- a/src/core/plugins/json-schema-2020-12/index.js
+++ b/src/core/plugins/json-schema-2020-12/index.js
@@ -39,6 +39,7 @@ import KeywordDescription from "./components/keywords/Description/Description"
import KeywordDefault from "./components/keywords/Default"
import KeywordDeprecated from "./components/keywords/Deprecated/Deprecated"
import KeywordReadOnly from "./components/keywords/ReadOnly/ReadOnly"
+import KeywordWriteOnly from "./components/keywords/WriteOnly/WriteOnly"
import Accordion from "./components/Accordion/Accordion"
import ExpandDeepButton from "./components/ExpandDeepButton/ExpandDeepButton"
import ChevronRightIcon from "./components/icons/ChevronRight"
@@ -85,6 +86,7 @@ const JSONSchema202012Plugin = () => ({
JSONSchema202012KeywordDefault: KeywordDefault,
JSONSchema202012KeywordDeprecated: KeywordDeprecated,
JSONSchema202012KeywordReadOnly: KeywordReadOnly,
+ JSONSchema202012KeywordWriteOnly: KeywordWriteOnly,
JSONSchema202012Accordion: Accordion,
JSONSchema202012ExpandDeepButton: ExpandDeepButton,
JSONSchema202012ChevronRightIcon: ChevronRightIcon,
diff --git a/src/core/plugins/oas31/wrap-components/models.jsx b/src/core/plugins/oas31/wrap-components/models.jsx
index 21cff9e5..df318e80 100644
--- a/src/core/plugins/oas31/wrap-components/models.jsx
+++ b/src/core/plugins/oas31/wrap-components/models.jsx
@@ -73,6 +73,7 @@ const ModelsWrapper = createOnlyOAS31ComponentWrapper(({ getSystem }) => {
const KeywordDefault = getComponent("JSONSchema202012KeywordDefault")
const KeywordDeprecated = getComponent("JSONSchema202012KeywordDeprecated")
const KeywordReadOnly = getComponent("JSONSchema202012KeywordReadOnly")
+ const KeywordWriteOnly = getComponent("JSONSchema202012KeywordWriteOnly")
const Accordion = getComponent("JSONSchema202012Accordion")
const ExpandDeepButton = getComponent("JSONSchema202012ExpandDeepButton")
const ChevronRightIcon = getComponent("JSONSchema202012ChevronRightIcon")
@@ -122,6 +123,7 @@ const ModelsWrapper = createOnlyOAS31ComponentWrapper(({ getSystem }) => {
KeywordDefault,
KeywordDeprecated,
KeywordReadOnly,
+ KeywordWriteOnly,
Accordion,
ExpandDeepButton,
ChevronRightIcon,