Skip to content

PropertyValidationParams

The propertyValidationParams section allows you to create the validation rules for each business entity property.

It is very useful for validating data consistency, for example: required fields, valid data and fields value patterns.

Fields

A propertyValidationParam contains the following fields to be defined:

PropertyName

The name of entity property to which validation will be applied.

Requirements Rules:

  • Is Required;
  • The name must exist in the Properties list for the validation entity

Example:

1
2
PropertyValidationParams:
- PropertyName: Property01


StopOnFirstRuleFailure

Allows you to configure whether the validation process for the property will be interrupted at the first failure found in the validation chain.

If this field is set to false, validation will continue throughout the chain of property validation rules and return a collection of failures with all rules violated.

Example:

1
2
3
PropertyValidationParams:
- PropertyName: Property01
  StopOnFirstRuleFailure: true


ForEachRule

Allows you to use the same validation rules to multiple items in a collection.

If this field is set to 'true', validation rules will be applied for each collection item.

Requirements Rules:

  • If 'true', property type must be a collection

Example:

1
2
3
4
PropertyValidationParams:
- PropertyName: Property01
  StopOnFirstRuleFailure: true
  ForEachRule: false


Rules

The list of validation rules for the current property.

Requirements Rules:

  • Is Required.
  • Each rule on list must follows rules as specified in ValidationRules

Example:

1
2
3
4
5
6
7
8
9
PropertyValidationParams:
- PropertyName: Property01
  StopOnFirstRuleFailure: true
  ForEachRule: false
  Rules:
  - Type: IsNotEmpty
    ...
  - Type: IsEmailAddress
    ...


Back to top