Skip to content

Fix tuple items not getting scoped in the schema editor - #2495

Open
magic-peach wants to merge 1 commit into
json-schema-org:mainfrom
magic-peach:fix/tuple-items-scope
Open

magic-peach wants to merge 1 commit into
json-schema-org:mainfrom
magic-peach:fix/tuple-items-scope

Conversation

@magic-peach

@magic-peach magic-peach commented Sep 12, 2026 •

Copy link
Copy Markdown

What kind of change does this PR introduce?

A bug fix.

Issue Number:

Screenshots/videos:

None.

If relevant, did you update the documentation?

Not applicable, this only changes the schema editor's internal scoping logic.

Summary

getScopesOfParsedJsonSchema walks a parsed schema to find where each type definition sits, so the editor knows which keywords to make interactively clickable. For an array schema, it always looked at items as a single schema and recursed once. When items is an array (tuple validation, used for example on the Draft 2020-12 release notes page and the JSON Schema examples page), each entry is itself a schema, so the function returned only one scope for the whole array and silently skipped every tuple entry.

This checks whether items is an array and, if so, recurses into each entry with an indexed path (['items'][0], ['items'][1], and so on), matching how array elements are already pathed elsewhere in the editor.

Does this PR introduce a breaking change?

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

@github-actions

Copy link
Copy Markdown

Hi @magic-peach! Thanks a lot for your contribution!

I noticed that the following required information is missing or incomplete: issue reference

Please update the PR description to include this information. You can find placeholders in the PR template for these items.

Thanks a lot!

@codecov

codecov Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (5158a0a) to head (4fe5bbc).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #2495   +/-   ##
=========================================
  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 has not been deployed

No deployments
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