diff --git a/.changeset/new-squids-approve.md b/.changeset/new-squids-approve.md
new file mode 100644
index 000000000..7f86a1ebe
--- /dev/null
+++ b/.changeset/new-squids-approve.md
@@ -0,0 +1,6 @@
+---
+"@gitbook/react-openapi": patch
+"gitbook": patch
+---
+
+Mark properties as optional if not required
diff --git a/packages/gitbook/src/components/DocumentView/OpenAPI/style.css b/packages/gitbook/src/components/DocumentView/OpenAPI/style.css
index 1c2592c3b..b406446f2 100644
--- a/packages/gitbook/src/components/DocumentView/OpenAPI/style.css
+++ b/packages/gitbook/src/components/DocumentView/OpenAPI/style.css
@@ -201,6 +201,10 @@
@apply text-warning-subtle text-[0.813rem];
}
+.openapi-schema-optional {
+ @apply text-info-subtle text-[0.813rem];
+}
+
.openapi-schema-readonly {
@apply text-primary-subtle/9 text-[0.813rem];
}
diff --git a/packages/react-openapi/src/OpenAPISchemaName.tsx b/packages/react-openapi/src/OpenAPISchemaName.tsx
index 056efb3b6..8883d7061 100644
--- a/packages/react-openapi/src/OpenAPISchemaName.tsx
+++ b/packages/react-openapi/src/OpenAPISchemaName.tsx
@@ -32,7 +32,11 @@ export function OpenAPISchemaName(props: OpenAPISchemaNameProps) {
) : null}
{schema?.readOnly ? read-only : null}
- {required ? required : null}
+ {required ? (
+ required
+ ) : (
+ optional
+ )}
{schema?.deprecated ? Deprecated : null}
);