Skip to content
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

Supplement zSchema validation required errors for nested definitions #126

Open
sophypal opened this issue Nov 3, 2017 · 0 comments
Open

Comments

@sophypal
Copy link
Member

sophypal commented Nov 3, 2017

Currently, zSchema will only report required errors for the top-level field missing. ember-frost-bunsen relies on these messages to highlight fields that are missing. There was previous work done before to resolve this by making all required fields initialized with empty objects but that was a contradiction to the meaning of required as it allowed the form to pass validation without errors for required fields.

What needs to be done is to replace the required errors with errors targeting the child fields. This can be tricky with arrays because arrays can't be further processed without having a value. Unlike an object whose fields are statically defined, the length of an array is dynamic.

What complicates this further is a form can reference an array item without having the array item exist initially but we need to provide appropriate error messages for them as well. So we would obviously need to tap into the view schema during this processing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant