Automatically Added Validators
Automatically added validators, like AutoRequire and AutoInEnum, simplify the validation process by automatically applying commonly needed rules based on the data type or structure of your properties.
Required
When the AutoRequire option is enabled, Validly automatically adds a Required
validator to every property of a reference type that is not nullable. This ensures that non-nullable properties are always validated for presence, reducing the need for manual annotations and promoting more concise and reliable validation rules.
InEnum
When the AutoInEnum option is enabled, Validly automatically adds a InEnum
validator to every Enum property. This ensures that the property value is always validated against the defined set of enum members, preventing invalid or undefined values from passing through.
Last updated