mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-16 15:45:13 +00:00
Mark OpenAPI properties as optional if not required (#3021)
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
"@gitbook/react-openapi": patch
|
||||||
|
"gitbook": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Mark properties as optional if not required
|
||||||
@@ -201,6 +201,10 @@
|
|||||||
@apply text-warning-subtle text-[0.813rem];
|
@apply text-warning-subtle text-[0.813rem];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.openapi-schema-optional {
|
||||||
|
@apply text-info-subtle text-[0.813rem];
|
||||||
|
}
|
||||||
|
|
||||||
.openapi-schema-readonly {
|
.openapi-schema-readonly {
|
||||||
@apply text-primary-subtle/9 text-[0.813rem];
|
@apply text-primary-subtle/9 text-[0.813rem];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,11 @@ export function OpenAPISchemaName(props: OpenAPISchemaNameProps) {
|
|||||||
) : null}
|
) : null}
|
||||||
</span>
|
</span>
|
||||||
{schema?.readOnly ? <span className="openapi-schema-readonly">read-only</span> : null}
|
{schema?.readOnly ? <span className="openapi-schema-readonly">read-only</span> : null}
|
||||||
{required ? <span className="openapi-schema-required">required</span> : null}
|
{required ? (
|
||||||
|
<span className="openapi-schema-required">required</span>
|
||||||
|
) : (
|
||||||
|
<span className="openapi-schema-optional">optional</span>
|
||||||
|
)}
|
||||||
{schema?.deprecated ? <span className="openapi-deprecated">Deprecated</span> : null}
|
{schema?.deprecated ? <span className="openapi-deprecated">Deprecated</span> : null}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user