robertLichtnow / zod-formik-adapter

An adapter for zod object validation to Formik validation schema
https://www.npmjs.com/package/zod-formik-adapter
MIT License
159 stars 15 forks source link

Support flattened `union` errors #19

Open SpencerKaiser opened 1 year ago

SpencerKaiser commented 1 year ago

Is your feature request related to a problem? Please describe. When schema validation takes place for a union type, the end result is an error object with a single message of Invalid input, which strips a lot of useful information out of the validation flow.

Describe the solution you'd like Some method of specifying (or preferably a breaking change that would make this behavior default) to essentially flatten the errors into a root object like any other validation result.

Describe alternatives you've considered Trying to refactor my schema to prevent a union from being necessary, which I don't think is possible...

Additional context Add any other context or screenshots about the feature request here.