JsonGuard class

Security layer for inbound JSON — sanitizes structure, then validates.

Not a renamed ValidatorExtensions.safeParse: runs structural security checks (depth, key budget, prototype keys) before the schema sees data.

Constructors

JsonGuard({JsonGuardOptions options = const JsonGuardOptions()})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
options JsonGuardOptions
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

guard<T>(dynamic raw, Validator<T> schema) ParseResult<T>
Applies security checks to raw, then validates with schema.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parseJson<T>(String source, Validator<T> schema) ParseResult<T>
Decodes source, applies security checks, then validates with schema.
parseJsonOrThrow<T>(String source, Validator<T> schema) → T
Like parseJson but throws ValidationException on any failure.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited