Zod · Method
.strict
The .strict() method makes unknown keys invalid for an object schema. A parse fails when the input contains a key not declared in the schema.
Last updated
Syntax
schema.strict()In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
z.object()z.strictObject()z.looseObject().catchall().parse()safeParse()