Skip to content

JsonSchema

type JsonSchema = { properties: Record<string, JsonSchema>; required?: string[]; type: "object" } | { additionalProperties: JsonSchema; type: "object" } | { items: JsonSchema; type: "array" } | { enum?: readonly string[]; format?: string; maxLength?: number; minLength?: number; pattern?: string; type: "string" } | { maximum?: number; minimum?: number; type: "integer" | "number" } | { type: "boolean" } | { anyOf: JsonSchema[] } | Record<string, never>

The JSON Schema fragment shape toJsonSchema produces.

Learn: Serialization

Last updated: