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
Jsonschema array tuples can lead to submittable forms that don't meet the schema #2862
Comments
We didn't add the Related issues: |
If the array component knew whether it was working with a list or a tuple, couldn't it simply not let the user delete from the middle of the tuple? As far as I can tell, that would prevent the problem from happening in the first place. |
This issue has been fixed and released as part of 5.10.23 release. Please let us know, in case you are still encountering a similar issue/problem. |
Description
The Formly
array
component doesn't have a way to distinguish between list-validation arrays and tuple-validation arrays. This can cause problems because tuple-validation means the position of elements matters. As the current implementation seems to assume list-validation, always allowing users to delete items from the middle of an array, it is possible for a user to arrive at a form that believes itself valid without actually meeting the schema.Minimal Reproduction
https://stackblitz.com/edit/formly-jsonschema-tuple-shenanigans?file=src%2Fassets%2Fjson-schema%2Ftuple.json
Your Environment
Additional context
This minimal example was based on the second negative example under json-schema.org's explanation of tuple validation.
The text was updated successfully, but these errors were encountered: