Closed ni-co closed 8 months ago
Using Versions Prisma v. 5.2.0 zod-prisma-types v. 2.7.9
There is an issue with umlauts and accented characters not being converted correctly in rich comments:
E.g. this rich comment
model Project { /// @zod.custom.use(z.string().email({ message: "Gültige E-Mail-Adresse eingeben" }).optional()) email String? }
causes the following Zod schema conversion:
export const ProjectSchema = z.object({ /** * .email({ message: "Gültige E-Mail-Adresse eingeben" }).optional()) */ email: z.string(.nullable(), })
Whereas this Prisma schema:
model Project { /// @zod.custom.use(z.string().email({ message: "Gueltige E-Mail-Adresse eingeben" }).optional()) email String? }
converts correctly to this Zod schema:
export const ProjectSchema = z.object({ email: z.string().email({ message: "Gueltige E-Mail-Adresse eingeben" }).optional().nullable(), })
@ni-co This should work now in the latest version 2.7.13
2.7.13
Using Versions Prisma v. 5.2.0 zod-prisma-types v. 2.7.9
There is an issue with umlauts and accented characters not being converted correctly in rich comments:
E.g. this rich comment
causes the following Zod schema conversion:
Whereas this Prisma schema:
converts correctly to this Zod schema: