Open lugrinder opened 2 years ago
For example, a schema like this:
model Test { id Int @id @default(autoincrement()) /// @zod.custom(z.nativeEnum(imports.State)) state Int @default(0) }
Where State is defined in imports like:
State
imports
export enum State { ONE, TWO, THREE }
Generates:
export const TestModel = z.object({ id: z.number().int(), state: z.nativeEnum(imports.State).int() })
Which is invalid because nativeEnum is number and don't have .int(). I can replace with a custom refine, but this is not the question...
nativeEnum
.int()
refine
For example, a schema like this:
Where
State
is defined inimports
like:Generates:
Which is invalid because
nativeEnum
is number and don't have.int()
. I can replace with a customrefine
, but this is not the question...