check method

void check(
  1. dynamic object,
  2. ValidationContext context
)

Implementation

void check(dynamic object, ValidationContext context) {
  for ( Test test in tests) {
    if (!test.run(object)) {
      context.addViolation(
        type: test.type,
        name: test.name,
        params: test.params,
        path: context.path,
        value: object,
        message: test.message ?? ""
      );

      if ( test.stop) {
        break;
      }
    }
  }
}