You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, how create zodtype with object props from external types?
// Generated type from APItypeUser={id: numbername: string}constUserSchema=z.ZodType<User>=z.object({id: z.number(),name: z.string()})UserSchema.pick// not working// Property 'pick' does not exist on type 'ZodType<User, ZodTypeDef, User>'.
The text was updated successfully, but these errors were encountered:
Maybe you are looking to construct a validation object (z.object(...)) with a type. I believe that's not possible because of the compile time/run time limitations. I suppose you are looking something like this:
// Generated type from APItypeUser={id: number;name: string;};constUserSchema: z.ZodObject<any,any,any,User>=z.object({id: z.number(),name: z.string(),});UserSchema.pick;// now it works
Hello, how create zodtype with object props from external types?
The text was updated successfully, but these errors were encountered: