Fix OpenAPI enum display (#3077)

This commit is contained in:
Nolann B.
2025-04-02 10:15:19 +02:00
committed by GitHub
parent da7b369ffd
commit 139a8050a5
3 changed files with 22 additions and 22 deletions
+6
View File
@@ -0,0 +1,6 @@
---
'@gitbook/react-openapi': patch
'gitbook': patch
---
Fix OpenAPI enum display
@@ -265,15 +265,11 @@
/* Schema Enum */
.openapi-schema-enum {
@apply flex flex-row text-sm leading-relaxed gap-2 flex-wrap text-tint;
}
.openapi-schema-enum-list {
@apply flex flex-row gap-1.5 items-center;
@apply text-sm leading-relaxed max-w-full text-tint;
}
.openapi-schema-enum-value {
@apply text-sm;
@apply text-sm mr-1.5;
}
.openapi-schema-enum-value:first-child {
+14 -16
View File
@@ -275,22 +275,20 @@ function OpenAPISchemaEnum(props: {
}
return (
<div className="openapi-schema-enum">
<span>Available options:</span>
<div className="openapi-schema-enum-list">
{enumValues.map((item, index) => (
<span key={index} className="openapi-schema-enum-value">
<OpenAPICopyButton
value={item.value}
label={item.description}
withTooltip={!!item.description}
>
<code>{`${item.value}`}</code>
</OpenAPICopyButton>
</span>
))}
</div>
</div>
<span className="openapi-schema-enum">
Available options:{' '}
{enumValues.map((item, index) => (
<span key={index} className="openapi-schema-enum-value">
<OpenAPICopyButton
value={item.value}
label={item.description}
withTooltip={!!item.description}
>
<code>{`${item.value}`}</code>
</OpenAPICopyButton>
</span>
))}
</span>
);
}