Skip to content

prefixItems should not allow arrays of variable length #193

@markoutso

Description

@markoutso

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Do not closeThis is a long term issue with dependant issues. This label prevent it to be closed automatically.💬 QuestionFurther information is requested📝 DocumentationIndicates improvements or additions to documentation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions