chrishoermann / zod-prisma-types

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

using `.optional()` on a field #156

Closed NazCodeland closed 1 year ago

NazCodeland commented 1 year ago

Hey, I noticed that @zod.string.email() works but @zod.string.optional() doesn't work. Is there documentation on all the available zod validators available through prisma rich comments?

NazCodeland commented 1 year ago

/// @zod.custom.use(z.string().optional())

@zod.custom.use() is what I didn't understand.

Got it !

you can delete this issue.