bhartsfield
07/26/2022, 12:44 PMthis.constraints.append( {
"array1": { "requiredIf": { "array2": nullValue() } },
"array2": { "requiredIf": { "array1": nullValue() } }
} );
But, if I populate it with the following and validate it...
{ "array1": [1,2,3] }
I get an exception form the validation module
lucee.runtime.exp.ExpressionException: can't compare Complex Object Type Array with a String
at lucee.runtime.type.util.ArraySupport.compareTo(ArraySupport.java:290)
at lucee.runtime.op.Operator.compare(Operator.java:202)
at lucee.runtime.op.Operator.compare(Operator.java:74)
at models.validators.requiredifvalidator_cfc$cf$49.udfCall(/cbvalidation/models/validators/RequiredIfValidator.cfc:57)
at ...
wil-shiftinsert
07/26/2022, 1:37 PMthis.constraints.append( {
"array1": { "requiredUnless": "array2" },
"array2": { "requiredUnless": "array1" }
} );
bhartsfield
07/26/2022, 1:44 PM