Fix OpenAPI alternatives not showing (#3699)

This commit is contained in:
Nolann B.
2025-10-03 13:06:10 +02:00
committed by GitHub
parent badf3a92f6
commit a4c33997fe
3 changed files with 17 additions and 11 deletions
+6
View File
@@ -0,0 +1,6 @@
---
"@gitbook/react-openapi": patch
"gitbook": patch
---
Fix OpenAPI alternatives not showing
@@ -840,7 +840,7 @@ body:has(.openapi-select-popover) {
}
.openapi-disclosure-trigger-label {
@apply absolute right-3 px-2 h-5 justify-end shrink-0 ring-tint-subtle truncate text-tint duration-300 transition-all rounded straight-corners:rounded-none circular-corners:rounded-xl flex flex-row gap-1 items-center text-xs;
@apply absolute right-3 mr-px px-2 h-5 justify-end shrink-0 ring-tint-subtle truncate text-tint duration-300 transition-all rounded straight-corners:rounded-none circular-corners:rounded-xl flex flex-row gap-1 items-center text-xs;
}
.openapi-disclosure-trigger-label span {
+10 -10
View File
@@ -60,16 +60,6 @@ function OpenAPISchemaProperty(
const header = <OpenAPISchemaPresentation context={context} property={property} />;
const content = (() => {
if (properties?.length) {
return (
<OpenAPISchemaProperties
properties={properties}
circularRefs={circularRefs}
context={context}
/>
);
}
if (alternatives?.schemas) {
const { schemas, discriminator } = alternatives;
return (
@@ -94,6 +84,16 @@ function OpenAPISchemaProperty(
);
}
if (properties?.length) {
return (
<OpenAPISchemaProperties
properties={properties}
circularRefs={circularRefs}
context={context}
/>
);
}
return null;
})();