@morojs/moro / z / ZodJSONSchema
Interface: ZodJSONSchema
Defined in: node_modules/zod/v4/classic/schemas.d.cts:669
Extends
_ZodJSONSchema
Properties
~~_def~~
_def:
$ZodUnionDef
<[ZodString
,ZodNumber
,ZodBoolean
,ZodNull
,ZodArray
<ZodJSONSchema
>,ZodRecord
<ZodString
,ZodJSONSchema
>]>
Defined in: node_modules/zod/v4/classic/schemas.d.cts:8
Deprecated
Use .def
instead.
Inherited from
_ZodJSONSchema._def
~~_input~~
Defined in: node_modules/zod/v4/classic/schemas.d.cts:12
Deprecated
Use z.input<typeof schema>
instead.
Inherited from
_ZodJSONSchema._input
~~_output~~
Defined in: node_modules/zod/v4/classic/schemas.d.cts:10
Deprecated
Use z.output<typeof schema>
instead.
Inherited from
_ZodJSONSchema._output
_zod
_zod:
ZodJSONSchemaInternals
Defined in: node_modules/zod/v4/classic/schemas.d.cts:670
Overrides
_ZodJSONSchema._zod
~standard
~standard:
$ZodStandardSchema
<ZodJSONSchema
>
Defined in: node_modules/zod/v4/core/schemas.d.cts:90
Inherited from
_ZodJSONSchema.~standard
def
def:
$ZodUnionDef
<[ZodString
,ZodNumber
,ZodBoolean
,ZodNull
,ZodArray
<ZodJSONSchema
>,ZodRecord
<ZodString
,ZodJSONSchema
>]>
Defined in: node_modules/zod/v4/classic/schemas.d.cts:5
Inherited from
_ZodJSONSchema.def
description?
optional
description:string
Defined in: node_modules/zod/v4/classic/schemas.d.cts:53
Inherited from
_ZodJSONSchema.description
options
Defined in: node_modules/zod/v4/classic/schemas.d.cts:456
Inherited from
_ZodJSONSchema.options
spa()
spa: (
data
,params?
) =>Promise
<ZodSafeParseResult
<JSONType
>>
Defined in: node_modules/zod/v4/classic/schemas.d.cts:23
Parameters
data
unknown
params?
Returns
Promise
<ZodSafeParseResult
<JSONType
>>
Inherited from
_ZodJSONSchema.spa
type
type:
"union"
Defined in: node_modules/zod/v4/classic/schemas.d.cts:6
Inherited from
_ZodJSONSchema.type
Methods
and()
and<
T
>(incoming
):ZodIntersection
<ZodJSONSchema
,T
>
Defined in: node_modules/zod/v4/classic/schemas.d.cts:45
Type Parameters
T
T
extends SomeType
Parameters
incoming
T
Returns
ZodIntersection
<ZodJSONSchema
, T
>
Inherited from
_ZodJSONSchema.and
array()
array():
ZodArray
<ZodJSONSchema
>
Defined in: node_modules/zod/v4/classic/schemas.d.cts:43
Returns
ZodArray
<ZodJSONSchema
>
Inherited from
_ZodJSONSchema.array
brand()
brand<
T
>(value?
):PropertyKey
extendsT
?ZodJSONSchema
:$ZodBranded
<ZodJSONSchema
,T
>
Defined in: node_modules/zod/v4/classic/schemas.d.cts:18
Type Parameters
T
T
extends PropertyKey
= PropertyKey
Parameters
value?
T
Returns
PropertyKey
extends T
? ZodJSONSchema
: $ZodBranded
<ZodJSONSchema
, T
>
Inherited from
_ZodJSONSchema.brand
catch()
Call Signature
catch(
def
):ZodCatch
<ZodJSONSchema
>
Defined in: node_modules/zod/v4/classic/schemas.d.cts:47
Parameters
def
Returns
ZodCatch
<ZodJSONSchema
>
Inherited from
_ZodJSONSchema.catch
Call Signature
catch(
def
):ZodCatch
<ZodJSONSchema
>
Defined in: node_modules/zod/v4/classic/schemas.d.cts:48
Parameters
def
(ctx
) => JSONType
Returns
ZodCatch
<ZodJSONSchema
>
Inherited from
_ZodJSONSchema.catch
check()
check(...
checks
):this
Defined in: node_modules/zod/v4/classic/schemas.d.cts:13
Parameters
checks
...(CheckFn
<JSONType
> | $ZodCheck
<JSONType
>)[]
Returns
this
Inherited from
_ZodJSONSchema.check
clone()
clone(
def?
,params?
):this
Defined in: node_modules/zod/v4/classic/schemas.d.cts:14
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: node_modules/zod/v4/classic/schemas.d.cts:25
Parameters
data
params?
Returns
Inherited from
_ZodJSONSchema.decode
decodeAsync()
decodeAsync(
data
,params?
):Promise
<JSONType
>
Defined in: node_modules/zod/v4/classic/schemas.d.cts:27
Parameters
data
params?
Returns
Promise
<JSONType
>
Inherited from
_ZodJSONSchema.decodeAsync
default()
Call Signature
default(
def
):ZodDefault
<ZodJSONSchema
>
Defined in: node_modules/zod/v4/classic/schemas.d.cts:39
Parameters
def
Returns
ZodDefault
<ZodJSONSchema
>
Inherited from
_ZodJSONSchema.default
Call Signature
default(
def
):ZodDefault
<ZodJSONSchema
>
Defined in: node_modules/zod/v4/classic/schemas.d.cts:40
Parameters
def
() => JSONType
Returns
ZodDefault
<ZodJSONSchema
>
Inherited from
_ZodJSONSchema.default
describe()
describe(
description
):this
Defined in: node_modules/zod/v4/classic/schemas.d.cts:52
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: node_modules/zod/v4/classic/schemas.d.cts:24
Parameters
data
params?
Returns
Inherited from
_ZodJSONSchema.encode
encodeAsync()
encodeAsync(
data
,params?
):Promise
<JSONType
>
Defined in: node_modules/zod/v4/classic/schemas.d.cts:26
Parameters
data
params?
Returns
Promise
<JSONType
>
Inherited from
_ZodJSONSchema.encodeAsync
~~isNullable()~~
isNullable():
boolean
Defined in: node_modules/zod/v4/classic/schemas.d.cts:74
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: node_modules/zod/v4/classic/schemas.d.cts:65
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():
undefined
| {[key
:string
]:unknown
;deprecated?
:boolean
;description?
:string
;id?
:string
;title?
:string
; }
Defined in: node_modules/zod/v4/classic/schemas.d.cts:55
Returns the metadata associated with this instance in z.globalRegistry
Returns
undefined
| {[key
: string
]: unknown
; deprecated?
: boolean
; description?
: string
; id?
: string
; title?
: string
; }
Inherited from
_ZodJSONSchema.meta
Call Signature
meta(
data
):this
Defined in: node_modules/zod/v4/classic/schemas.d.cts:57
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: node_modules/zod/v4/classic/schemas.d.cts:36
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: node_modules/zod/v4/classic/schemas.d.cts:37
Returns
ZodNullable
<ZodJSONSchema
>
Inherited from
_ZodJSONSchema.nullable
nullish()
nullish():
ZodOptional
<ZodNullable
<ZodJSONSchema
>>
Defined in: node_modules/zod/v4/classic/schemas.d.cts:38
Returns
ZodOptional
<ZodNullable
<ZodJSONSchema
>>
Inherited from
_ZodJSONSchema.nullish
optional()
optional():
ZodOptional
<ZodJSONSchema
>
Defined in: node_modules/zod/v4/classic/schemas.d.cts:35
Returns
ZodOptional
<ZodJSONSchema
>
Inherited from
_ZodJSONSchema.optional
or()
or<
T
>(option
):ZodUnion
<[ZodJSONSchema
,T
]>
Defined in: node_modules/zod/v4/classic/schemas.d.cts:44
Type Parameters
T
T
extends SomeType
Parameters
option
T
Returns
ZodUnion
<[ZodJSONSchema
, T
]>
Inherited from
_ZodJSONSchema.or
overwrite()
overwrite(
fn
):this
Defined in: node_modules/zod/v4/classic/schemas.d.cts:34
Parameters
fn
(x
) => JSONType
Returns
this
Inherited from
_ZodJSONSchema.overwrite
parse()
parse(
data
,params?
):JSONType
Defined in: node_modules/zod/v4/classic/schemas.d.cts:19
Parameters
data
unknown
params?
Returns
Inherited from
_ZodJSONSchema.parse
parseAsync()
parseAsync(
data
,params?
):Promise
<JSONType
>
Defined in: node_modules/zod/v4/classic/schemas.d.cts:21
Parameters
data
unknown
params?
Returns
Promise
<JSONType
>
Inherited from
_ZodJSONSchema.parseAsync
pipe()
pipe<
T
>(target
):ZodPipe
<ZodJSONSchema
,T
>
Defined in: node_modules/zod/v4/classic/schemas.d.cts:49
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: node_modules/zod/v4/classic/schemas.d.cts:41
Parameters
def
() => JSONType
Returns
ZodPrefault
<ZodJSONSchema
>
Inherited from
_ZodJSONSchema.prefault
Call Signature
prefault(
def
):ZodPrefault
<ZodJSONSchema
>
Defined in: node_modules/zod/v4/classic/schemas.d.cts:42
Parameters
def
Returns
ZodPrefault
<ZodJSONSchema
>
Inherited from
_ZodJSONSchema.prefault
readonly()
readonly():
ZodReadonly
<ZodJSONSchema
>
Defined in: node_modules/zod/v4/classic/schemas.d.cts:50
Returns
ZodReadonly
<ZodJSONSchema
>
Inherited from
_ZodJSONSchema.readonly
refine()
refine(
check
,params?
):this
Defined in: node_modules/zod/v4/classic/schemas.d.cts:32
Parameters
check
(arg
) => unknown
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, this check will only be executed if the function returns true
. Defaults to payload => z.util.isAborted(payload)
.
Returns
this
Inherited from
_ZodJSONSchema.refine
register()
register<
R
>(registry
, ...meta
):this
Defined in: node_modules/zod/v4/classic/schemas.d.cts:17
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: node_modules/zod/v4/classic/schemas.d.cts:29
Parameters
data
params?
Returns
Inherited from
_ZodJSONSchema.safeDecode
safeDecodeAsync()
safeDecodeAsync(
data
,params?
):Promise
<ZodSafeParseResult
<JSONType
>>
Defined in: node_modules/zod/v4/classic/schemas.d.cts:31
Parameters
data
params?
Returns
Promise
<ZodSafeParseResult
<JSONType
>>
Inherited from
_ZodJSONSchema.safeDecodeAsync
safeEncode()
safeEncode(
data
,params?
):ZodSafeParseResult
<JSONType
>
Defined in: node_modules/zod/v4/classic/schemas.d.cts:28
Parameters
data
params?
Returns
Inherited from
_ZodJSONSchema.safeEncode
safeEncodeAsync()
safeEncodeAsync(
data
,params?
):Promise
<ZodSafeParseResult
<JSONType
>>
Defined in: node_modules/zod/v4/classic/schemas.d.cts:30
Parameters
data
params?
Returns
Promise
<ZodSafeParseResult
<JSONType
>>
Inherited from
_ZodJSONSchema.safeEncodeAsync
safeParse()
safeParse(
data
,params?
):ZodSafeParseResult
<JSONType
>
Defined in: node_modules/zod/v4/classic/schemas.d.cts:20
Parameters
data
unknown
params?
Returns
Inherited from
_ZodJSONSchema.safeParse
safeParseAsync()
safeParseAsync(
data
,params?
):Promise
<ZodSafeParseResult
<JSONType
>>
Defined in: node_modules/zod/v4/classic/schemas.d.cts:22
Parameters
data
unknown
params?
Returns
Promise
<ZodSafeParseResult
<JSONType
>>
Inherited from
_ZodJSONSchema.safeParseAsync
superRefine()
superRefine(
refinement
):this
Defined in: node_modules/zod/v4/classic/schemas.d.cts:33
Parameters
refinement
(arg
, ctx
) => void
| Promise
<void
>
Returns
this
Inherited from
_ZodJSONSchema.superRefine
transform()
transform<
NewOut
>(transform
):ZodPipe
<ZodJSONSchema
,ZodTransform
<Awaited
<NewOut
>,JSONType
>>
Defined in: node_modules/zod/v4/classic/schemas.d.cts:46
Type Parameters
NewOut
NewOut
Parameters
transform
(arg
, ctx
) => NewOut
| Promise
<NewOut
>
Returns
ZodPipe
<ZodJSONSchema
, ZodTransform
<Awaited
<NewOut
>, JSONType
>>
Inherited from
_ZodJSONSchema.transform