zod-prisma-types
zod-prisma-types copied to clipboard
support generating out types which normalize to zod .dateOut()
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:
- https://github.com/RobinTail/express-zod-api#dealing-with-dates
- https://github.com/RobinTail/express-zod-api/discussions/537
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()
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