Skip to content

Commit 61db166

Browse files
authored
Add OpenAPI write-only indicator (#3059)
1 parent 0d9b9ce commit 61db166

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

.changeset/nasty-radios-brake.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@gitbook/react-openapi': patch
3+
'gitbook': patch
4+
---
5+
6+
Add OpenAPI write-only indicator

packages/gitbook/src/components/DocumentView/OpenAPI/style.css

+4
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,10 @@
209209
@apply text-primary-subtle/9 text-[0.813rem];
210210
}
211211

212+
.openapi-schema-writeonly {
213+
@apply text-success dark:text-success-subtle/9 text-[0.813rem];
214+
}
215+
212216
.openapi-schema-type {
213217
@apply text-tint select-text text-[0.813rem] font-mono [word-spacing:-0.25rem];
214218
}

packages/react-openapi/src/OpenAPISchemaName.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ export function OpenAPISchemaName(props: OpenAPISchemaNameProps) {
3232
) : null}
3333
</span>
3434
{schema?.readOnly ? <span className="openapi-schema-readonly">read-only</span> : null}
35+
{schema?.writeOnly ? (
36+
<span className="openapi-schema-writeonly">write-only</span>
37+
) : null}
3538
{required ? (
3639
<span className="openapi-schema-required">required</span>
3740
) : (

0 commit comments

Comments
 (0)