Can Vorms provide pass/fail results for each validation specification?
Rock070 opened this issue · 1 comments
Describe the bug
Can the value of Error return the correctness or error of each verification rule? When I meet the need to dynamically match each rule, I find that when Vorms
verifies an error in yupResolver, it will stop at the first error. The subsequent verification will not continue. If I can get the results of multiple verification rules verification, it will provide me with great convenience.
thank you for your dedication
Reproduction
https://stackblitz.com/edit/vorms-validate-with-yup-12529w?file=src/App.vue
Steps to reproduce
Fill capital AA
in the password field and press send, the following two rules will not pass:
min(8)
lowercase()
Expect to get two errors, and error messages.
eachErrors: {
min: {
ok: false,
message: `password must be at least 8 characters`,
},
lowercase: {
ok: false,
message: `password must be a lowercase string`,
}
}
Or other data formats that can get multiple validation errors.
Thank you.
This is a great idea to make error messages more flexible, but it conflicts with the current error object structure, and it will breaks the simple and clear DX, so may not be supported in this major version.