Type 'ZodObject<{ data: ZodUnion<[ZodLazy<ZodType<Omit<ItemCreateManyCategoryInput, "tenantID">, ZodTypeDef, Omit<ItemCreateManyCategoryInput, "tenantID">>>, ZodArray<...>]>; skipDuplicates: ZodOptional<...>; }, "strict", ZodTypeAny, { ...; }, { ...; }>' is not assignable to type 'ZodType<ItemCreateManyCategoryInputEnvelope, ZodTypeDef, ItemCreateManyCategoryInputEnvelope>'.
The types of '_type.data' are incompatible between these types.
Type 'Omit<ItemCreateManyCategoryInput, "tenantID"> | Omit<ItemCreateManyCategoryInput, "tenantID">[]' is not assignable to type 'Enumerable<ItemCreateManyCategoryInput>'.
Type 'Omit<ItemCreateManyCategoryInput, "tenantID">' is not assignable to type 'Enumerable<ItemCreateManyCategoryInput>'.
Property 'tenantID' is missing in type 'Omit<ItemCreateManyCategoryInput, "tenantID">' but required in type 'ItemCreateManyCategoryInput'.typescript(2322)
index.d.ts(4632, 5): 'tenantID' is declared here.
const ItemCreateManyCategoryInputEnvelopeSchema: z.ZodType<Prisma.ItemCreateManyCategoryInputEnvelope, z.ZodTypeDef, Prisma.ItemCreateManyCategoryInputEnvelope>
Description of issue
I am getting type error when using omit feature on a schema that has relational fields.
Dependencies
"@prisma/client": "4.16.2" "zod": "3.21.1" "zod-prisma-type": "2.5.6" "typescript": "5.0.2"
Also tried with
"@prisma/client": "5.2.0" "zod": "3.21.1" "zod-prisma-type": "2.7.9" "typescript": "5.0.2"
Code
Error from typescript
Getting error on this generated code
Error
Link to codesandbox