pablo-abc / felte

An extensible form library for Svelte, Solid and React
https://felte.dev
MIT License
1.01k stars 43 forks source link

fix(validator-zod): Surface nested errors when validating a union type #294

Open sea-grass opened 5 months ago

sea-grass commented 5 months ago

Closes #248, #290.

Fixes the Zod validator to surface nested invalid_union errors.

For existing users of @felte/validator-zod, validation behaviour is the same. The only difference is that Zod issues with an invalid_union code will now be recursively crawled for their nested issues. Validation works exactly the same, but usage of a union type may now show errors where they weren't shown before.

vercel[bot] commented 5 months ago

@sea-grass is attempting to deploy a commit to the Pablo Alejandro Berganza Campos' projects Team on Vercel.

A member of the Team first needs to authorize it.