Implements a constraint structure that can be more easily mapped to client-side representations of the same constraint.
DataType implementations now defer to a common pool of defined constraint functions, rather than implementing their own custom validation methods.
Also adds 'required' field.
The order that constraint are applied is important. A Required=true constraint should be applied before a minLength=5 constraint, for example. However, the constraints are implemented in such a way that - usually - the combination isn't order dependent.
Constraints do not short circuit. All constraints will be tested, and error messages / error message keys will be returned in a list.
Implements a constraint structure that can be more easily mapped to client-side representations of the same constraint.
DataType implementations now defer to a common pool of defined constraint functions, rather than implementing their own custom validation methods.
Also adds 'required' field.
The order that constraint are applied is important. A Required=true constraint should be applied before a minLength=5 constraint, for example. However, the constraints are implemented in such a way that - usually - the combination isn't order dependent.
Constraints do not short circuit. All constraints will be tested, and error messages / error message keys will be returned in a list.
ggranum included the following code: https://github.com/dotCMS/core/pull/8726/commits