Skip to main content
Type validators check the type and format of values, ensuring data conforms to expected structures.
Type validators generally don’t use transforms since they check data types rather than string content. See Validators Overview for transform documentation.

not_null!

Checks that a value exists and is not null/None.
Use not_null!: true as a first validator to ensure the target exists before applying other validators.

type!

Checks that a value is of a specific type.

Supported Types

not_type!

Checks that a value is NOT of a specific type. This is the negated form of type!.

json!

Checks that a string value is valid JSON.
The json! validator only checks that the string is valid JSON. It does not validate the JSON structure. Use contains! or pattern! for content checks.

email!

Checks that a string value is a valid email format.

Common Patterns

Structured Output Validation

Type-Safe Numeric Results

Span Output Type Checking

Validating Nested Fields