-
-
Notifications
You must be signed in to change notification settings - Fork 273
prefixItems should not allow arrays of variable length #193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
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? |
@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! |
I agree "tuple" isn't a perfect description, but I think it's more helpful than misleading. 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. |
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 |
Hi all. What could be the best term we should use to replace Tuple in our docs? |
"Tuple" appears on these pages: |
Hello! 👋 This issue has been automatically marked as stale due to inactivity 😴 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 ❤️ |
@benjagm can we use "list" instead of "tuple" coming from python background I agree that tuple can be confusing sometimes for me as well |
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.The text was updated successfully, but these errors were encountered: