-
-
Notifications
You must be signed in to change notification settings - Fork 286
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.