The underlying schema type to modify
Creates a new nullable modifier wrapping the given schema.
The schema to make nullable
Define the input type of the schema, including null
The output value of the field with null support. The property points to a type only and not the real value.
Type marker for camelCase output type inference
Mark the field under validation as optional. An optional field allows both null and undefined values.
A new OptionalModifier wrapping this nullable schema
Creates a fresh instance of the underlying schema type and wraps it inside the nullable modifier.
A cloned instance of this nullable modifier
Compiles to compiler node by delegating to the parent schema and setting the allowNull flag.
Name of the property being compiled
Reference store for the compiler
Parser options
Compiled compiler node with null support
Modifies the schema type to allow null values in addition to the original schema type. This is useful for optional database fields or API responses that may contain null values.
Example