Skip to content

fix: render nested arrays as Type[][] in Schema tab (#1114) - #1465

Merged
sserrata merged 1 commit into
mainfrom
fix/nested-arrays-schema-name-1114
May 12, 2026
Merged

sserrata merged 1 commit into
mainfrom
fix/nested-arrays-schema-name-1114

Conversation

@sserrata

Copy link
Copy Markdown
Member

Summary

  • Fixes Nested arrays doesn't display object type in schema tab #1114: nested arrays (e.g. array of array of Step) rendered as array[] in the Schema tab instead of Step[][]
  • getSchemaName now recurses on schema.items, so each level of nesting appends another [] (applied to both the plugin and theme copies)
  • Adds unit tests in both packages and a demo fixture (demo/examples/tests/nestedArrays.yaml) covering arrays of objects nested two and three levels deep

Test plan

  • yarn jest packages/*/src/markdown/schema.test.ts — 10/10 pass
  • yarn workspace demo start, open the Nested Arrays group under Tests, and verify the Schema tab shows Step[][] for routes, integer[][] for matrix, and string[][][] for cube

🤖 Generated with Claude Code

getSchemaName only descended one level into schema.items, so an
array-of-arrays-of-objects rendered as `array[]` instead of `Type[][]`.
Recurse on schema.items so each level of nesting appends another `[]`.

Adds unit tests in both packages and a demo fixture
(demo/examples/tests/nestedArrays.yaml) covering arrays of arrays of
objects and arrays nested two and three levels deep.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@github-actions

Copy link
Copy Markdown

Size Change: +6.07 kB (+0.26%)

Total Size: 2.32 MB

📦 View Changed
Filename Size Change
demo/.docusaurus/globalData.json 76.2 kB +833 B (+1.11%)
demo/.docusaurus/registry.js 110 kB +1.2 kB (+1.1%)
demo/.docusaurus/routes.js 104 kB +1.16 kB (+1.13%)
demo/.docusaurus/routesChunkNames.json 43.3 kB +484 B (+1.13%)
demo/build/assets/js/main.********.js 682 kB +2.14 kB (+0.31%)
demo/build/assets/js/runtime~main.********.js 25.1 kB +248 B (+1%)
ℹ️ View Unchanged
Filename Size
demo/.docusaurus/codeTranslations.json 2 B
demo/.docusaurus/docusaurus.config.mjs 16.4 kB
demo/.docusaurus/i18n.json 372 B
demo/.docusaurus/site-metadata.json 1.58 kB
demo/build/assets/css/styles.********.css 173 kB
demo/build/index.html 99.5 kB
demo/build/petstore/add-pet/index.html 30 kB
demo/build/petstore/create-user/index.html 24.7 kB
demo/build/petstore/create-users-with-array-input/index.html 24.8 kB
demo/build/petstore/create-users-with-list-input/index.html 24.8 kB
demo/build/petstore/delete-order/index.html 24.5 kB
demo/build/petstore/delete-pet/index.html 24.8 kB
demo/build/petstore/delete-user/index.html 25 kB
demo/build/petstore/find-pets-by-status/index.html 25.5 kB
demo/build/petstore/find-pets-by-tags/index.html 26.1 kB
demo/build/petstore/get-inventory/index.html 23.8 kB
demo/build/petstore/get-order-by-id/index.html 24.8 kB
demo/build/petstore/get-pet-by-id/index.html 25.6 kB
demo/build/petstore/get-user-by-name/index.html 25.1 kB
demo/build/petstore/login-user/index.html 25.6 kB
demo/build/petstore/logout-user/index.html 24.4 kB
demo/build/petstore/new-pet/index.html 25 kB
demo/build/petstore/pet/index.html 23.2 kB
demo/build/petstore/place-order/index.html 24 kB
demo/build/petstore/schemas/apiresponse/index.html 25.2 kB
demo/build/petstore/schemas/cat/index.html 39 kB
demo/build/petstore/schemas/category/index.html 26.3 kB
demo/build/petstore/schemas/dog/index.html 39.3 kB
demo/build/petstore/schemas/honeybee/index.html 39.3 kB
demo/build/petstore/schemas/id/index.html 23.4 kB
demo/build/petstore/schemas/order/index.html 27.3 kB
demo/build/petstore/schemas/pet/index.html 38.8 kB
demo/build/petstore/schemas/tag/index.html 24.7 kB
demo/build/petstore/schemas/user/index.html 40.7 kB
demo/build/petstore/store/index.html 22.2 kB
demo/build/petstore/subscribe-to-the-store-events/index.html 30.9 kB
demo/build/petstore/swagger-petstore-yaml/index.html 30.9 kB
demo/build/petstore/update-pet-with-form/index.html 25 kB
demo/build/petstore/update-pet/index.html 25.4 kB
demo/build/petstore/update-user/index.html 25 kB
demo/build/petstore/upload-file/index.html 24.8 kB
demo/build/petstore/user/index.html 22.9 kB

compressed-size-action

@github-actions

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit b087afb):

https://docusaurus-openapi-36b86--pr1465-m463j4b3.web.app

(expires Tue, 19 May 2026 15:54:23 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: bf293780ee827f578864d92193b8c2866acd459f

@sserrata
sserrata merged commit ff7275b into main May 12, 2026
12 checks passed
@sserrata
sserrata deleted the fix/nested-arrays-schema-name-1114 branch May 12, 2026 16:51

This branch was previously deployed

1 inactive deployment
preview — b087afbe Deployed May 12, 2026 by sserrata via Deploy #2140
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nested arrays doesn't display object type in schema tab

1 participant