json-schema-org / json-schema-org/website
prefixItems should not allow arrays of variable length
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 169
- Forks
- 484
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 6
Description
The documentation states that the keyword prefixItems is used for tuple validation.
In the realm of programming and mathematics a tuple is something that has specific length.
Quoting Wikipedia:
In computer science, tuples come in many forms. Most typed functional programming languages implement tuples directly as product types,[1] tightly associated with algebraic data types, pattern matching, and destructuring assignment.[2] Many programming languages offer an alternative to tuples, known as record types, featuring unordered elements accessed by label.[3] A few programming languages combine ordered tuple product types and unordered record types into a single construct, as in C structs and Haskell records. Relational databases may formally identify their rows (records) as tuples.
The json schema specification should follow common conventions or choose a better description for this validation.
In my opinion referring to arrays with variable as length as tuples is something that goes against the definition of the tuple and creates unnecessary confusion.
I would suggest that prefixItems stays as it is and it requires that all sub schemas validate the array elements in order. No more elements or should be allowed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the current documentation and specification language for prefixItems, then consider the issue's proposed fixed-length interpretation against the existing tuple-validation terminology. Done means the project reaches and records a maintainer-approved decision about the behavior and its documentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- json
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100