Skip to content

Field Name Validations

Run validations on the field names to check for field name count of existence of field names.

Count Equal

Ensure field name count is equal to certain number.

validation().fieldNames().countEqual(3)
validation.fieldNames.countEqual(3)
- fieldNameType: "fieldCountEqual"
  count: "3"

Not Equal

Ensure field name count is between two numbers.

validation().fieldNames().countBetween(10, 12)
validation.fieldNames.countBetween(10, 12)
- fieldNameType: "fieldCountBetween"
  minCount: "10"
  maxCount: "12"

Match Order

Ensure all field names match particular ordering and is complete.

validation().fieldNames().matchOrder("account_id", "amount", "name")
validation.fieldNames.matchOrder("account_id", "amount", "name")
- fieldNameType: "fieldNameMatchOrder"
  names: ["account_id", "amount", "name"]

Match Set

Ensure field names contains set of expected names. Order is not checked.

validation().fieldNames().matchSet("account_id", "first_name")
validation.fieldNames.matchSet("account_id", "first_name")
- fieldNameType: "fieldNameMatchSet"
  names: ["account_id", "first_name"]