Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/unlucky-pumpkins-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@gitbook/react-openapi": patch
"gitbook": patch
---

Fix OpenAPI alternatives not showing
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
20 changes: 10 additions & 10 deletions packages/react-openapi/src/OpenAPISchema.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -94,6 +84,16 @@ function OpenAPISchemaProperty(
);
}

if (properties?.length) {
return (
<OpenAPISchemaProperties
properties={properties}
circularRefs={circularRefs}
context={context}
/>
);
}

return null;
})();

Expand Down