Demo: preview a Zod validation schema
Zod schemas combine type shape and runtime validation. A visual preview helps reviewers understand required fields, refinements, enums, and nested objects.
- Show field names and validators together.
- Separate transform logic from simple validation when possible.
- Use preview screenshots in PRs for form or API validation changes.
const UserSchema = z.object({
email: z.string().email(),
role: z.enum(["admin", "member"]),
age: z.number().int().min(18).optional()
});