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 */ /* Schema Enum */
.openapi-schema-enum { .openapi-schema-enum {
@apply flex flex-row text-sm leading-relaxed gap-2 flex-wrap text-tint; @apply text-sm leading-relaxed max-w-full text-tint;
}
.openapi-schema-enum-list {
@apply flex flex-row gap-1.5 items-center;
} }
.openapi-schema-enum-value { .openapi-schema-enum-value {
@apply text-sm; @apply text-sm mr-1.5;
} }
.openapi-schema-enum-value:first-child { .openapi-schema-enum-value:first-child {
+14 -16
View File
@@ -275,22 +275,20 @@ function OpenAPISchemaEnum(props: {
} }
return ( return (
<div className="openapi-schema-enum"> <span className="openapi-schema-enum">
<span>Available options:</span> Available options:{' '}
<div className="openapi-schema-enum-list"> {enumValues.map((item, index) => (
{enumValues.map((item, index) => ( <span key={index} className="openapi-schema-enum-value">
<span key={index} className="openapi-schema-enum-value"> <OpenAPICopyButton
<OpenAPICopyButton value={item.value}
value={item.value} label={item.description}
label={item.description} withTooltip={!!item.description}
withTooltip={!!item.description} >
> <code>{`${item.value}`}</code>
<code>{`${item.value}`}</code> </OpenAPICopyButton>
</OpenAPICopyButton> </span>
</span> ))}
))} </span>
</div>
</div>
); );
} }