From bd353489e98cf770565d1e168bf24e86a09643da Mon Sep 17 00:00:00 2001 From: "Nolann B." <100787331+nolannbiron@users.noreply.github.com> Date: Fri, 28 Mar 2025 06:53:28 +0100 Subject: [PATCH] Fix missing alternative schemas (#3058) --- .changeset/chilled-eggs-attack.md | 5 +++++ packages/react-openapi/src/OpenAPISchema.tsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/chilled-eggs-attack.md diff --git a/.changeset/chilled-eggs-attack.md b/.changeset/chilled-eggs-attack.md new file mode 100644 index 000000000..ae9fe8277 --- /dev/null +++ b/.changeset/chilled-eggs-attack.md @@ -0,0 +1,5 @@ +--- +'@gitbook/react-openapi': patch +--- + +Fix missing alternative schemas diff --git a/packages/react-openapi/src/OpenAPISchema.tsx b/packages/react-openapi/src/OpenAPISchema.tsx index a012a1ec5..c7f384d99 100644 --- a/packages/react-openapi/src/OpenAPISchema.tsx +++ b/packages/react-openapi/src/OpenAPISchema.tsx @@ -50,7 +50,7 @@ function OpenAPISchemaProperty(props: { circularRefs.set(schema, id); const properties = getSchemaProperties(schema); - if (properties) { + if (properties?.length) { return (