Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Restrict a value to a fixed set of choices.
enum
{ "type": "object", "properties": { "priority": { "enum": ["low", "medium", "high"] }, "status": { "enum": ["open", "in_progress", "closed"] } }, "required": ["priority", "status"], "additionalProperties": false }
from typing import Literal from pydantic import BaseModel, ConfigDict class Payload(BaseModel): model_config = ConfigDict(extra="forbid") priority: Literal["low", "medium", "high"] status: Literal["open", "in_progress", "closed"]
import { z } from "zod"; const payloadSchema = z .object({ priority: z.enum(["low", "medium", "high"]), status: z.enum(["open", "in_progress", "closed"]), }) .strict();
{ "type": "object", "properties": { "score": { "enum": [1, 2, 3, "unknown", null] } }, "required": ["score"], "additionalProperties": false }
from typing import Literal from pydantic import BaseModel, ConfigDict class Payload(BaseModel): model_config = ConfigDict(extra="forbid") score: Literal[1, 2, 3, "unknown"] | None
import { z } from "zod"; const payloadSchema = z .object({ score: z.union([ z.literal(1), z.literal(2), z.literal(3), z.literal("unknown"), z.null(), ]), }) .strict();