[coldbox:17118] [cb 3.1] - Validate subset of constraints

Don’t know if this is the best way, but what I’ve done before is to create a “validationsets” structure in my service. For each named key in the structure (e.g., ‘simple’, ‘complex’, ‘step1’, etc), I define the properties of the object that I want to validate for the given validation set.

Then, when I run validateModel(), I pass in the desired validation set as the “fields” argument.

This lets me be very flexible about which properties I validate in what scenario, but still allows me to keep all the validation definitions in one place.