In order to have a third-party library validate an attribute based on constraints, a constraintsValidation
callback can be provided. The underlying function receives a constraints object and returns an attribute validation callback. Here’s an example for using Validate.js: