diff --git a/.changeset/stupid-peaches-work.md b/.changeset/stupid-peaches-work.md new file mode 100644 index 0000000000..c02e5af9a7 --- /dev/null +++ b/.changeset/stupid-peaches-work.md @@ -0,0 +1,6 @@ +--- +"@gitbook/react-openapi": patch +"gitbook": patch +--- + +Fix spec properties rendering and missing keys diff --git a/bun.lock b/bun.lock index 60e9df3047..0e59b1dbd8 100644 --- a/bun.lock +++ b/bun.lock @@ -241,6 +241,7 @@ "@scalar/oas-utils": "^0.2.120", "clsx": "^2.1.1", "flatted": "^3.2.9", + "json-decycle": "^4.0.0", "json-xml-parse": "^1.3.0", "react-aria": "^3.37.0", "react-aria-components": "^1.6.0", @@ -2069,6 +2070,8 @@ "json-buffer": ["json-buffer@3.0.0", "", {}, "sha512-CuUqjv0FUZIdXkHPI8MezCnFCdaTAacej1TZYulLoAg1h/PhwkdXFN4V/gzY4g+fMBCOV2xF+rp7t2XD2ns/NQ=="], + "json-decycle": ["json-decycle@4.0.0", "", {}, "sha512-3GFL/vWazCbMu1kw+NdIfAHh6Ugq5pxkKcSUnK1f/Fw1nDtt1i+BiBfRJs0iPEKscYAz4k4+osvgjY95hmuJXQ=="], + "json-parse-even-better-errors": ["json-parse-even-better-errors@2.3.1", "", {}, "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w=="], "json-schema": ["json-schema@0.4.0", "", {}, "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA=="], diff --git a/packages/gitbook/src/components/DocumentView/Blocks.tsx b/packages/gitbook/src/components/DocumentView/Blocks.tsx index 844e8238af..903acd2955 100644 --- a/packages/gitbook/src/components/DocumentView/Blocks.tsx +++ b/packages/gitbook/src/components/DocumentView/Blocks.tsx @@ -54,7 +54,7 @@ export function UnwrappedBlocks(props: UnwrappedBl const { nodes, blockStyle, isOffscreen: defaultIsOffscreen = false, ...contextProps } = props; let isOffscreen = defaultIsOffscreen; - return nodes.map((node) => { + return nodes.map((node, index) => { isOffscreen = isOffscreen || isBlockOffscreen({ @@ -65,7 +65,7 @@ export function UnwrappedBlocks(props: UnwrappedBl return ( ( ) { const { nodes, document, ancestorInlines, ...contextProps } = props; - return nodes.map((node) => { + return nodes.map((node, index) => { + const key = node.key || `key-${index}`; + if (node.object === 'text') { - return ; + return ; } return ( - {(children || selectedTab?.body) && toggeable ? ( + {selectedTab?.body && toggeable ? (