Open samchungy opened 1 year ago
It would be very useful to have some information stored against the ZodObject about the object which was extended from.
Context: I'm trying to create a plugin which will be enhanced by knowing when an object extended another.
eg.
const a = z.object({ prop1: z.string() }); const b = a.extend({ prop2: z.string() }); console.log(b._def.extends) // returns reference to a
@samchungy FYI: #2206
Haha touche https://github.com/samchungy/zod-openapi/blob/13e8c9236821b7e559ad724d9b3b6d33ca2893d4/src/extendZod.ts#L98. Still would be nice to be native
It would be very useful to have some information stored against the ZodObject about the object which was extended from.
Context: I'm trying to create a plugin which will be enhanced by knowing when an object extended another.
eg.