validate method

  1. @override
JarResult validate(
  1. dynamic value, [
  2. Map<String, dynamic>? allValues,
  3. String? path,
  4. Object? root,
])
override

Implementation

@override
JarResult validate(dynamic value,
    [Map<String, dynamic>? allValues, String? path, Object? root]) {
  final base = super.validate(value, allValues, path, root ?? value);
  if (!base.isValid) return base;

  dynamic output = value;
  for (final schema in schemas) {
    final result = schema.validate(output, allValues, path, root ?? value);
    if (!result.isValid) return result;
    output = result.value;
  }
  return JarResult.success(output);
}