buildValidators<T> function

List<Validator<T>> buildValidators<T>(
  1. JsonSchemaProperty<Object> element,
  2. bool required
)

Implementation

List<Validator<T>> buildValidators<T>(
    JsonSchemaProperty element, bool required) {
  final List<Validator<T>> validators = [];

  if (required) {
    validators.add(const NotNullValidator('This field cannot be null'));
  }

  return validators;
}