Handle OpenAPI read-only properties (#2962)

This commit is contained in:
Nolann B.
2025-03-11 11:37:11 +01:00
committed by GitHub
parent 9bc3d504c8
commit c60e9ba27f
3 changed files with 11 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@gitbook/react-openapi': patch
---
Handle read-only in OpenAPISchemaName
@@ -198,7 +198,11 @@
}
.openapi-schema-required {
@apply text-amber-600 text-[0.813rem];
@apply text-warning-subtle text-[0.813rem];
}
.openapi-schema-readonly {
@apply text-primary-subtle/9 text-[0.813rem];
}
.openapi-schema-type {
@@ -30,6 +30,7 @@ export function OpenAPISchemaName(props: OpenAPISchemaNameProps) {
<span className="openapi-schema-type">{additionalItems}</span>
) : null}
</span>
{schema?.readOnly ? <span className="openapi-schema-readonly">read-only</span> : null}
{required ? <span className="openapi-schema-required">required</span> : null}
{schema?.deprecated ? <span className="openapi-deprecated">Deprecated</span> : null}
</div>