Updates the validatorProducer
argument of the setValidator
rule so that it can optionally take the base model being validated.
This change allows nested validators to depend on the state of the base model, by accepting the base model as a constructor argument.
Example:
this.ruleFor('nestedProperty')
.setValidator(baseModel => new NestedValidator(baseModel));