Skip to main content

Interface: ZodJSONSchema

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:812

Extends​

  • _ZodJSONSchema

Properties​

_def​

_def: $ZodUnionDef<[ZodString, ZodNumber, ZodBoolean, ZodNull, ZodArray<ZodJSONSchema>, ZodRecord<ZodString, ZodJSONSchema>]>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:11

Deprecated​

Use .def instead.

Inherited from​

_ZodJSONSchema._def


_input​

_input: string | number | boolean | Record<string, JSONType> | JSONType[] | null

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:15

Deprecated​

Use z.input<typeof schema> instead.

Inherited from​

_ZodJSONSchema._input


_output​

_output: string | number | boolean | Record<string, JSONType> | JSONType[] | null

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:13

Deprecated​

Use z.output<typeof schema> instead.

Inherited from​

_ZodJSONSchema._output


_zod​

_zod: ZodJSONSchemaInternals

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:813

Overrides​

_ZodJSONSchema._zod


~standard​

~standard: ZodStandardSchemaWithJSON<ZodJSONSchema>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:534

Inherited from​

_ZodJSONSchema.~standard


def​

def: $ZodUnionDef<[ZodString, ZodNumber, ZodBoolean, ZodNull, ZodArray<ZodJSONSchema>, ZodRecord<ZodString, ZodJSONSchema>]>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:8

Inherited from​

_ZodJSONSchema.def


description?​

optional description: string

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:63

Inherited from​

_ZodJSONSchema.description


options​

options: [ZodString, ZodNumber, ZodBoolean, ZodNull, ZodArray<ZodJSONSchema>, ZodRecord<ZodString, ZodJSONSchema>]

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:535

Inherited from​

_ZodJSONSchema.options


spa()​

spa: (data, params?) => Promise<ZodSafeParseResult<JSONType>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:30

Parameters​

data​

unknown

params?​

ParseContext<$ZodIssue>

Returns​

Promise<ZodSafeParseResult<JSONType>>

Inherited from​

_ZodJSONSchema.spa


type​

type: "union"

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:9

Inherited from​

_ZodJSONSchema.type

Methods​

and()​

and<T>(incoming): ZodIntersection<ZodJSONSchema, T>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:55

Type Parameters​

T​

T extends SomeType

Parameters​

incoming​

T

Returns​

ZodIntersection<ZodJSONSchema, T>

Inherited from​

_ZodJSONSchema.and


apply()​

apply<T, TArgs>(fn, ...args): T

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:85

Type Parameters​

T​

T

TArgs​

TArgs extends unknown[] = []

Parameters​

fn​

(schema, ...args) => T

args​

...TArgs

Returns​

T

Inherited from​

_ZodJSONSchema.apply


array()​

array(): ZodArray<ZodJSONSchema>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:53

Returns​

ZodArray<ZodJSONSchema>

Inherited from​

_ZodJSONSchema.array


brand()​

brand<T, Dir>(value?): PropertyKey extends T ? ZodJSONSchema : $ZodBranded<ZodJSONSchema, T, Dir>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:25

Type Parameters​

T​

T extends PropertyKey = PropertyKey

Dir​

Dir extends "inout" | "in" | "out" = "out"

Parameters​

value?​

T

Returns​

PropertyKey extends T ? ZodJSONSchema : $ZodBranded<ZodJSONSchema, T, Dir>

Inherited from​

_ZodJSONSchema.brand


catch()​

Call Signature​

catch(def): ZodCatch<ZodJSONSchema>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:57

Parameters​
def​

JSONType

Returns​

ZodCatch<ZodJSONSchema>

Inherited from​

_ZodJSONSchema.catch

Call Signature​

catch(def): ZodCatch<ZodJSONSchema>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:58

Parameters​
def​

(ctx) => JSONType

Returns​

ZodCatch<ZodJSONSchema>

Inherited from​

_ZodJSONSchema.catch


check()​

check(...checks): this

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:19

Parameters​

checks​

...(CheckFn<JSONType> | $ZodCheck<JSONType>)[]

Returns​

this

Inherited from​

_ZodJSONSchema.check


clone()​

clone(def?, params?): this

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:21

Parameters​

def?​

$ZodUnionDef<[ZodString, ZodNumber, ZodBoolean, ZodNull, ZodArray<ZodJSONSchema>, ZodRecord<ZodString, ZodJSONSchema>]>

params?​
parent​

boolean

Returns​

this

Inherited from​

_ZodJSONSchema.clone


decode()​

decode(data, params?): JSONType

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:34

Parameters​

data​

JSONType

params?​

ParseContext<$ZodIssue>

Returns​

JSONType

Inherited from​

_ZodJSONSchema.decode


decodeAsync()​

decodeAsync(data, params?): Promise<JSONType>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:36

Parameters​

data​

JSONType

params?​

ParseContext<$ZodIssue>

Returns​

Promise<JSONType>

Inherited from​

_ZodJSONSchema.decodeAsync


default()​

Call Signature​

default(def): ZodDefault<ZodJSONSchema>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:49

Parameters​
def​

JSONType

Returns​

ZodDefault<ZodJSONSchema>

Inherited from​

_ZodJSONSchema.default

Call Signature​

default(def): ZodDefault<ZodJSONSchema>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:50

Parameters​
def​

() => JSONType

Returns​

ZodDefault<ZodJSONSchema>

Inherited from​

_ZodJSONSchema.default


describe()​

describe(description): this

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:62

Returns a new instance that has been registered in z.globalRegistry with the specified description

Parameters​

description​

string

Returns​

this

Inherited from​

_ZodJSONSchema.describe


encode()​

encode(data, params?): JSONType

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:33

Parameters​

data​

JSONType

params?​

ParseContext<$ZodIssue>

Returns​

JSONType

Inherited from​

_ZodJSONSchema.encode


encodeAsync()​

encodeAsync(data, params?): Promise<JSONType>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:35

Parameters​

data​

JSONType

params?​

ParseContext<$ZodIssue>

Returns​

Promise<JSONType>

Inherited from​

_ZodJSONSchema.encodeAsync


exactOptional()​

exactOptional(): ZodExactOptional<ZodJSONSchema>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:45

Returns​

ZodExactOptional<ZodJSONSchema>

Inherited from​

_ZodJSONSchema.exactOptional


isNullable()​

isNullable(): boolean

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:84

Returns​

boolean

Deprecated​

Try safe-parsing null (this is what isNullable does internally):

const schema = z.string().nullable();
const isNullable = schema.safeParse(null).success; // true

Inherited from​

_ZodJSONSchema.isNullable


isOptional()​

isOptional(): boolean

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:75

Returns​

boolean

Deprecated​

Try safe-parsing undefined (this is what isOptional does internally):

const schema = z.string().optional();
const isOptional = schema.safeParse(undefined).success; // true

Inherited from​

_ZodJSONSchema.isOptional


meta()​

Call Signature​

meta(): {[key: string]: unknown; deprecated?: boolean; description?: string; id?: string; title?: string; } | undefined

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:65

Returns the metadata associated with this instance in z.globalRegistry

Returns​

{[key: string]: unknown; deprecated?: boolean; description?: string; id?: string; title?: string; } | undefined

Inherited from​

_ZodJSONSchema.meta

Call Signature​

meta(data): this

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:67

Returns a new instance that has been registered in z.globalRegistry with the specified metadata

Parameters​
data​
deprecated?​

boolean

description?​

string

id?​

string

title?​

string

Returns​

this

Inherited from​

_ZodJSONSchema.meta


nonoptional()​

nonoptional(params?): ZodNonOptional<ZodJSONSchema>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:46

Parameters​

params?​

string |

{ error?: string | $ZodErrorMap<$ZodIssueInvalidType<unknown>>; message?: string; }

error?​

string | $ZodErrorMap<$ZodIssueInvalidType<unknown>>

message?​

string

Deprecated

This parameter is deprecated. Use error instead.

Returns​

ZodNonOptional<ZodJSONSchema>

Inherited from​

_ZodJSONSchema.nonoptional


nullable()​

nullable(): ZodNullable<ZodJSONSchema>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:47

Returns​

ZodNullable<ZodJSONSchema>

Inherited from​

_ZodJSONSchema.nullable


nullish()​

nullish(): ZodOptional<ZodNullable<ZodJSONSchema>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:48

Returns​

ZodOptional<ZodNullable<ZodJSONSchema>>

Inherited from​

_ZodJSONSchema.nullish


optional()​

optional(): ZodOptional<ZodJSONSchema>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:44

Returns​

ZodOptional<ZodJSONSchema>

Inherited from​

_ZodJSONSchema.optional


or()​

or<T>(option): ZodUnion<[ZodJSONSchema, T]>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:54

Type Parameters​

T​

T extends SomeType

Parameters​

option​

T

Returns​

ZodUnion<[ZodJSONSchema, T]>

Inherited from​

_ZodJSONSchema.or


overwrite()​

overwrite(fn): this

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:43

Parameters​

fn​

(x) => JSONType

Returns​

this

Inherited from​

_ZodJSONSchema.overwrite


parse()​

parse(data, params?): JSONType

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:26

Parameters​

data​

unknown

params?​

ParseContext<$ZodIssue>

Returns​

JSONType

Inherited from​

_ZodJSONSchema.parse


parseAsync()​

parseAsync(data, params?): Promise<JSONType>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:28

Parameters​

data​

unknown

params?​

ParseContext<$ZodIssue>

Returns​

Promise<JSONType>

Inherited from​

_ZodJSONSchema.parseAsync


pipe()​

pipe<T>(target): ZodPipe<ZodJSONSchema, T>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:59

Type Parameters​

T​

T extends $ZodType<any, JSONType, $ZodTypeInternals<any, JSONType>>

Parameters​

target​

T | $ZodType<any, JSONType, $ZodTypeInternals<any, JSONType>>

Returns​

ZodPipe<ZodJSONSchema, T>

Inherited from​

_ZodJSONSchema.pipe


prefault()​

Call Signature​

prefault(def): ZodPrefault<ZodJSONSchema>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:51

Parameters​
def​

() => JSONType

Returns​

ZodPrefault<ZodJSONSchema>

Inherited from​

_ZodJSONSchema.prefault

Call Signature​

prefault(def): ZodPrefault<ZodJSONSchema>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:52

Parameters​
def​

JSONType

Returns​

ZodPrefault<ZodJSONSchema>

Inherited from​

_ZodJSONSchema.prefault


readonly()​

readonly(): ZodReadonly<ZodJSONSchema>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:60

Returns​

ZodReadonly<ZodJSONSchema>

Inherited from​

_ZodJSONSchema.readonly


refine()​

refine<Ch>(check, params?): Ch extends (arg) => arg is R ? ZodJSONSchema & ZodType<R, JSONType, $ZodTypeInternals<R, JSONType>> : ZodJSONSchema

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:41

Type Parameters​

Ch​

Ch extends (arg) => unknown

Parameters​

check​

Ch

params?​

string |

{ abort?: boolean; error?: string | $ZodErrorMap<NonNullable<$ZodIssue>>; message?: string; params?: Record<string, any>; path?: PropertyKey[]; when?: (payload) => boolean; }

abort?​

boolean

If true, no later checks will be executed if this check fails. Default false.

error?​

string | $ZodErrorMap<NonNullable<$ZodIssue>>

message?​

string

Deprecated

This parameter is deprecated. Use error instead.

params?​

Record<string, any>

path?​

PropertyKey[]

when?​

(payload) => boolean

If provided, the check runs only when this returns true. By default, it is skipped if prior parsing produced aborting issues.

Returns​

Ch extends (arg) => arg is R ? ZodJSONSchema & ZodType<R, JSONType, $ZodTypeInternals<R, JSONType>> : ZodJSONSchema

Inherited from​

_ZodJSONSchema.refine


register()​

register<R>(registry, ...meta): this

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:24

Type Parameters​

R​

R extends $ZodRegistry<MetadataType, $ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>>

Parameters​

registry​

R

meta​

...ZodJSONSchema extends R["_schema"] ? undefined extends R["_meta"] ? [$replace<R["_meta"], R["_schema"] & ZodJSONSchema>?] : [$replace<R["_meta"], R["_schema"] & ZodJSONSchema>] : ["Incompatible schema"]

Returns​

this

Inherited from​

_ZodJSONSchema.register


safeDecode()​

safeDecode(data, params?): ZodSafeParseResult<JSONType>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:38

Parameters​

data​

JSONType

params?​

ParseContext<$ZodIssue>

Returns​

ZodSafeParseResult<JSONType>

Inherited from​

_ZodJSONSchema.safeDecode


safeDecodeAsync()​

safeDecodeAsync(data, params?): Promise<ZodSafeParseResult<JSONType>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:40

Parameters​

data​

JSONType

params?​

ParseContext<$ZodIssue>

Returns​

Promise<ZodSafeParseResult<JSONType>>

Inherited from​

_ZodJSONSchema.safeDecodeAsync


safeEncode()​

safeEncode(data, params?): ZodSafeParseResult<JSONType>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:37

Parameters​

data​

JSONType

params?​

ParseContext<$ZodIssue>

Returns​

ZodSafeParseResult<JSONType>

Inherited from​

_ZodJSONSchema.safeEncode


safeEncodeAsync()​

safeEncodeAsync(data, params?): Promise<ZodSafeParseResult<JSONType>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:39

Parameters​

data​

JSONType

params?​

ParseContext<$ZodIssue>

Returns​

Promise<ZodSafeParseResult<JSONType>>

Inherited from​

_ZodJSONSchema.safeEncodeAsync


safeParse()​

safeParse(data, params?): ZodSafeParseResult<JSONType>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:27

Parameters​

data​

unknown

params?​

ParseContext<$ZodIssue>

Returns​

ZodSafeParseResult<JSONType>

Inherited from​

_ZodJSONSchema.safeParse


safeParseAsync()​

safeParseAsync(data, params?): Promise<ZodSafeParseResult<JSONType>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:29

Parameters​

data​

unknown

params?​

ParseContext<$ZodIssue>

Returns​

Promise<ZodSafeParseResult<JSONType>>

Inherited from​

_ZodJSONSchema.safeParseAsync


superRefine()​

superRefine(refinement, params?): this

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:42

Parameters​

refinement​

(arg, ctx) => void | Promise<void>

params?​

$ZodSuperRefineParams

Returns​

this

Inherited from​

_ZodJSONSchema.superRefine


toJSONSchema()​

toJSONSchema(params?): ZodStandardJSONSchemaPayload<ZodJSONSchema>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:18

Converts this schema to a JSON Schema representation.

Parameters​

params?​

ToJSONSchemaParams

Returns​

ZodStandardJSONSchemaPayload<ZodJSONSchema>

Inherited from​

_ZodJSONSchema.toJSONSchema


transform()​

transform<NewOut>(transform): ZodPipe<ZodJSONSchema, ZodTransform<Awaited<NewOut>, JSONType>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:56

Type Parameters​

NewOut​

NewOut

Parameters​

transform​

(arg, ctx) => NewOut | Promise<NewOut>

Returns​

ZodPipe<ZodJSONSchema, ZodTransform<Awaited<NewOut>, JSONType>>

Inherited from​

_ZodJSONSchema.transform


validate()​

validate(data, params?): data is JSONType

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:31

Parameters​

data​

unknown

params?​

ParseContext<$ZodIssue>

Returns​

data is JSONType

Inherited from​

_ZodJSONSchema.validate


validateAsync()​

validateAsync(data, params?): Promise<boolean>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:32

Parameters​

data​

unknown

params?​

ParseContext<$ZodIssue>

Returns​

Promise<boolean>

Inherited from​

_ZodJSONSchema.validateAsync


with()​

with(...checks): this

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:20

Parameters​

checks​

...(CheckFn<JSONType> | $ZodCheck<JSONType>)[]

Returns​

this

Inherited from​

_ZodJSONSchema.with