zod-prisma-types icon indicating copy to clipboard operation
zod-prisma-types copied to clipboard

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

Open miki725 opened this issue 1 year ago • 1 comments

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()

miki725 avatar Jul 17 '23 19:07 miki725

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

iNeoO avatar Apr 03 '24 10:04 iNeoO