chrishoermann / zod-prisma-types

Generator creates zod types for your prisma models with advanced validation
Other
579 stars 43 forks source link

support generating out types which normalize to zod .dateOut() #163

Open miki725 opened 11 months ago

miki725 commented 11 months ago

trying to use the generated schema with express-zod-api results in an error as the generated schema uses .date() fields or .coerse.date() for input types but neither is compatible with explicit .dateOut() field express-zod-api expects as that field explicitly normalizes Date() object to a string.

see:

would it be possible to generate out types compatible with express-zod-api. right now all schemas need to be manually extended to use dateOut()

iNeoO commented 3 months ago

Hi, i have the same problem, did you find a solution ?

Typechecking on output fail because date is parsed as string in json instead of Date