Skip to content

fix: resolve scoping failure for tuple items - #2523

Open
garv-sanveria wants to merge 4 commits into
json-schema-org:mainfrom
garv-sanveria:fix/tuple-items-scope
Open

garv-sanveria wants to merge 4 commits into
json-schema-org:mainfrom
garv-sanveria:fix/tuple-items-scope

Conversation

@garv-sanveria

Copy link
Copy Markdown

What kind of change does this PR introduce?
Bugfix

Issue Number:

Screenshots/videos:
N/A

If relevant, did you update the documentation?
N/A

Summary
When generating scopes for the interactive schema editor, getScopesOfParsedJsonSchema correctly recursed when items was an object. However, when items was an array (tuple validation), the array itself was passed to the recursive function, which lacked a .type property, causing the recursion to instantly stop and drop all sub-schemas.

This PR adds a simple Array.isArray() check to map over tuple items, ensuring their scopes are correctly generated. Also adds a Cypress test to prevent regression.

Does this PR introduce a breaking change?
No

Checklist

  • Read, understood, and followed the contributing guidelines.

@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
website ✅ Ready (View Log) Visit Preview af57880

@codecov

codecov Bot commented Sep 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (7b8104b) to head (af57880).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #2523   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           31        31           
  Lines          695       695           
  Branches       215       215           
=========================================
  Hits           695       695           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch was successfully deployed

1 active deployment
Preview — af578802 Deployed Sep 30, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready to review

Development

Successfully merging this pull request may close these issues.

Tuple items are not scoped in the interactive schema editor

1 participant