DefaultValidatorΒΆ

This is the default Validator, it supports all available error checks.

Example Code:

validators {
  DefaultValidator {
    model = DefaultValidator
    config {
      messageLimit = 1
      messageLimits {
        email = 2
      }
      restrictErrorChecks = LengthMax,LengthMin,Required,Email
      disableErrorCheckFields = firstName
      disableErrorCheckFields = {
        firstName = LengthMax,LengthMin
        email = Required
      }
      fields {
        firstName.errorChecks {
          lengthMax {
            model = LengthMax
            lengthMax = 20
          }
          lengthMin {
            model = LengthMin
            lengthMin = 10
          }
        }
        email.errorChecks {
          required {
            model = Required
          }
          email {
            model = Email
          }
        }
      }
    }
  }
}

Properties

messageLimit

Sets the default limits of error messages for all and fields.

Mandatory

False

Data Type

Integer

Default

1

messageLimits

List containing the field name path and limit of error messages for specific fields.

Mandatory

False

Data Type

Array<String, Integer>

Default

Empty Array

restrictErrorChecks

Comma separated list containing the error checks to perform.
If this is set, only these error checks will be executed, all other configured error checks will be ignored.

Mandatory

False

Data Type

String

Default

Empty String

disableErrorCheckFields

Comma separated list containing the field name path to disable error checks for.
If this is set, all configured error checks will be ignored, these fields.

Or a list containing the field name path as key and a comma separated list of error checks as values.

This setting can be altered by condition blocks depending on user input.

Mandatory

False

Data Type

String|Array<String, Error Checks>

Default

Empty String

fields

List containing the fields and error checks.

Mandatory

False

Data Type

Array<String, Field>

Default

Empty Array