validate method

List<SchemaViolation> validate(
  1. Map<String, dynamic> document
)

Validates document against the compiled schema.

Returns a list of every SchemaViolation found. An empty list means the document is valid. All violations are collected in a single pass so callers can surface every error at once.

Example:

final violations = validator.validate({'email': 'bob@example.com'});
for (final v in violations) {
  print(v); // e.g. "name: required field is missing"
}

Implementation

List<SchemaViolation> validate(Map<String, dynamic> document) {
  return _rule.validate(document, '');
}