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

Doesn't report errors of fields nested in an array when using zod #3184

Closed
Almoullim opened this issue Feb 23, 2021 · 1 comment
Closed

Doesn't report errors of fields nested in an array when using zod #3184

Almoullim opened this issue Feb 23, 2021 · 1 comment
Labels
🐛 bug Unintended behavior

Comments

@Almoullim
Copy link

Versions

  • vee-validate: ^4.1.17
  • vue: ^3.0.0

Describe the bug

With the following schema while using @vee-validate/zod

zod.object({
  contact: zod.object({
    email: zod.array(zod.string().nonempty("Required")).nonempty(),
    phone: zod.array(zod.string().nonempty("Required")).nonempty(),
  }),
})

with the names of the fields being contact.email[0] and contact.phone[0], vee-validate is letting the form pass as correct while actually when parsing the value returned by the submit handler using zod, zod is infact reporting the expected errors of those fields,

@logaretm
Copy link
Owner

Thank you for reporting this, I changed how the errors are sourced from zod which should resolve this, should be tagged in 4.1.20.

@logaretm logaretm added the 🐛 bug Unintended behavior label Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants