Open markoutso opened 2 years ago
Tuples are but one application of this keyword. I agree that it's odd they are highlighted as the reasoning behind the keyword, but it's current function does have merit.
Perhaps we can improve this section by focusing on what it does rather than try to illustrate one use case.
@jdesrosiers what do you think of moving the tuples language out of the spec and into the UJS content?
The documentation states...
@markoutso @gregsdennis I don't see "tuple" in this repo at all. Which documentation do you mean specifically? (Likely need to migrate the issue.)
I usually describe it as "tuple form" validation as opposed to tuple validation.
Thanks everyone for looking at this! @Relequestual I double checked and you are right. This belongs to the Understanding Json Schema book.
I agree "tuple" isn't a perfect description, but I think it's more helpful than misleading. prefixItems
(or previously array-form-items
) is primarily useful for describing a tuple. I think the way it's written makes it sound like, if you're using this keyword then you're describing a tuple, which isn't always true. I think I'd like the example to be a tuple and call it a tuple, but make it more clear that you can describe things that are not quite tuples with this keyword as well.
In any case, I have another three months before I'll have a chance to work on this. So, don't wait on me if anyone wants to put up a PR.
is primarily useful for describing a tuple
I think this is an incorrect assumption, and probably the basis of this confusion.
I've also previously expressed I think this language isn't really standard and is particularly confusing in languages which has a type called tuple
. So +1 from me at least for avoiding it, I wouldn't change any keywords at all personally, but I definitely do not use the word "tuple" in the context of JSON Schema or JSON more broadly myself.
Hi all. What could be the best term we should use to replace Tuple in our docs?
"Tuple" appears on these pages:
Hello! :wave:
This issue has been automatically marked as stale due to inactivity :sleeping:
It will be closed in 180 days if no further activity occurs. To keep it active, please add a comment with more details.
There can be many reasons why a specific issue has no activity. The most probable cause is a lack of time, not a lack of interest.
Let us figure out together how to push this issue forward. Connect with us through our slack channel : https://json-schema.org/slack
Thank you for your patience :heart:
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: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.