Open vidz1979 opened 6 months ago
@vidz1979 maybe you can try the option writeNullishInModelTypes this would result in a schema like
export const EntitySchema = z.object({
id: z.string().cuid(),
field: z.string().nullish(), // null or undefined
fieldWorkaround: z.string().optional().nullish(), //null or undefined
})
Describe the bug
My Prisma model is like this:
My generated Zod type is like that:
It's worth nothing that "String?" is producing a nullable field, which produces a required validation in forms. I need an optional field, which I achieved using a custom modifier.
Package versions (please complete the following information): "zod": "^3.22.4", "zod-prisma-types": "^3.1.6"