chrishoermann / zod-prisma-types

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

[BUG] Can't use `z.literal` with template string #231

Closed lambertkevin closed 1 month ago

lambertkevin commented 6 months ago

Describe the bug Using a zod.custom.use(z.literal(`foo${number}`) is impossible as it breaks the comment while generating the schema.

Screenshots schema.prisma:

Capture d’écran 2024-01-03 à 20 15 57

Result:

Capture d’écran 2024-01-03 à 20 16 09

Package versions (please complete the following information):