diff --git a/.changeset/fuzzy-buckets-talk.md b/.changeset/fuzzy-buckets-talk.md new file mode 100644 index 000000000..39a0cf45c --- /dev/null +++ b/.changeset/fuzzy-buckets-talk.md @@ -0,0 +1,6 @@ +--- +'@gitbook/react-openapi': patch +'gitbook': patch +--- + +Handle grouped OpenAPISchemas diff --git a/packages/gitbook/src/components/DocumentView/OpenAPI/OpenAPISchemas.tsx b/packages/gitbook/src/components/DocumentView/OpenAPI/OpenAPISchemas.tsx index e288e9047..b2a8415e1 100644 --- a/packages/gitbook/src/components/DocumentView/OpenAPI/OpenAPISchemas.tsx +++ b/packages/gitbook/src/components/DocumentView/OpenAPI/OpenAPISchemas.tsx @@ -50,6 +50,7 @@ async function OpenAPISchemasBody(props: BlockProps) { return ( - + ); } @@ -44,11 +48,12 @@ export function OpenAPISchemas(props: { function OpenAPIRootSchemasSchema(props: { schemas: OpenAPISchemasData['schemas']; context: OpenAPIClientContext; + grouped?: boolean; }) { - const { schemas, context } = props; + const { schemas, context, grouped } = props; - // If there is only one model, we show it directly. - if (schemas.length === 1) { + // If there is only one model and we are not grouping, we show it directly. + if (schemas.length === 1 && !grouped) { const schema = schemas?.[0]?.schema; if (!schema) {