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

Can Vorms provide pass/fail results for each validation specification? #17

Closed
Rock070 opened this issue Feb 18, 2023 · 1 comment · Fixed by #24
Closed

Can Vorms provide pass/fail results for each validation specification? #17

Rock070 opened this issue Feb 18, 2023 · 1 comment · Fixed by #24

Comments

@Rock070
Copy link
Contributor

Rock070 commented Feb 18, 2023

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

image

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.

@Mini-ghost
Copy link
Owner

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.

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

Successfully merging a pull request may close this issue.

2 participants