Using express-jsonschema
How to validation two fields, for example:
("quantity" == 0 && "actualQuantity" == 0) || ("quantity" > 0 && "actualQuantity" > 0)
Using express-jsonschema
How to validation two fields, for example:
("quantity" == 0 && "actualQuantity" == 0) || ("quantity" > 0 && "actualQuantity" > 0)
Just tested, this will do the job:
You could also use
"oneOf"
instead of"anyOf"
, but"anyOf"
is faster with most implementations.