Closed diogob closed 2 years ago
Hi, is there possibility to support zod's discriminated unions? Discriminated unions does not extend the AnyZodObject
so it's not possible to use it.
Hi @jansedlon could you open a separate issue with an example schema?
We could probably simplify the code quite a bit, but I want to validate the approach before investing more time.
Purpose
When a domain function received nested input data,
errorMessagesForSchema
should mirror that structure so we do not lose nested error information. This should address #24Technical details
This approach seems simpler than the one on #26 since it does not require any info from the schema (other than its type). Using this code we could keep backwards compatibility or break it just to drop the schema parameter (since we can use just the generic type parameter).