Tuple items are not scoped in the interactive schema editor

Open Beginner friendly
#2,496 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
frontend

Research direction

Start in lib/getScopesOfParsedJsonSchema.ts and inspect how array schemas recurse through items. Reproduce the behavior on the Draft 2020-12 release notes or JSON Schema examples page, then verify that each tuple entry receives its own scope and keyword highlighting works for all entries.

Written by the indexing model from the issue text.

Description

Status: Triage

The interactive schema editor uses getScopesOfParsedJsonSchema (lib/getScopesOfParsedJsonSchema.ts) to figure out which parts of a schema should be clickable. For an array schema it always treats items as a single schema and recurses once.

When items is an array instead (tuple validation), every entry in that array is its own schema, but the function only returns one scope for the whole thing and silently skips every tuple entry. This means keyword highlighting does not work correctly on any page using tuple-style items, including the Draft 2020-12 release notes page and the JSON Schema examples page.

Dominant language
HTML
Stars
169
Forks
484
Avg merge
7h 58m
Merged PRs (30d)
6

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from json-schema-org/website

All issues in json-schema-org/website

Similar issues

More Web Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.