Feature description
Add the interface to the resulting schema (the <Example> part):
export const ExampleSchema = z.object<Example>({
id: z.string(),
name: z.number(),
});
// or alternatively generate with `satisfies z.ZodType<Example>`
export const ExampleSchema = z.object({
id: z.string(),
name: z.number(),
}) satisfies z.Zodtype<Example>;
This way, if the programmer changes the Example interface, the interface and schema is now out of sync and they get a type-error as a reminder to re-sync.