Generate a Zod runtime validation schema from a sample JSON object. Auto-detects emails, URLs, and ISO datetimes.
import { z } from "zod";
export const UserSchema = z.object({
id: z.number().int(),
email: z.string().email(),
name: z.string(),
active: z.boolean(),
createdAt: z.string().datetime()
});
export type User = z.infer<typeof UserSchema>;