Forge Docs
Architecture

Schema

Zod スキーマと型定義

Schema

Zod スキーマと型定義を管理する。バリデーションの単一責任を持つ。

import { z } from "zod";

export const UserSchema = z.object({
  id: z.string().uuid(),
  name: z.string().min(1),
  email: z.string().email(),
});

export type User = z.infer<typeof UserSchema>;

On this page