Just tested, this will complete the task:
{ "anyOf" : [ { "properties" : { "quantity" : { "minimum" : 0, "maximum" : 0 }, "actualQuantity" : { "minimum" : 0, "maximum" : 0 } } }, { "properties" : { "quantity" : { "minimum" : 1 }, "actualQuantity" : { "minimum" : 1 } } } ] }
You can also use "oneOf" instead of "anyOf" , but "anyOf" faster in most implementations.
erosb source share