JsonValidationResult class

The result of a JsonSentinel.validate call.

On success, isValid is true and errors is empty. On failure, isValid is false and errors lists every problem found.

final result = JsonSentinel.validate(json: map, expectedTypes: schema);
if (!result.isValid) {
  for (final e in result.errors) print(e);
}

Constructors

JsonValidationResult.failure(List<String> errors)
A failed result carrying errors.
factory

Properties

errors List<String>
All validation errors found, in detection order.
final
hashCode int
The hash code for this object.
no setterinherited
isValid bool
Whether all validations passed.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Constants

success → const JsonValidationResult
A successful result with no errors.