chrishoermann / zod-prisma-types

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

Possible to omit only in CreateInputSchema but not UpdateInputSchema #104

Open NanFengCheong opened 1 year ago

NanFengCheong commented 1 year ago

I have a use case where I wanted only to omit Id in CreateInputSchema but not UpdateInputSchemam but if I put /// @zod.custom.omit([input]). It will omit in both CreateInputSchema and UpdateInputSchema.

chrishoermann commented 1 year ago

@NanFengCheong Currently it is only possible to omit the fields in all input types. A similar request was made in #97. I'll think about how this could be implemented and see when I find some free time to work on it.