Closed kris2214 closed 6 years ago
Consider I have a json schema as below: .... { "properties" : { "minimumDelay" : { "type" : "number" }, "length" : { "type" : "number" }, }, "required": { "minimumDelay", "length" }
Here the json data will be valid if I enter both minimumDelay and length values.
But my requirement is json data must be valid when I enter either 1 of the values(like XOR case). How my schema must be modified to achieve the same?
This would be handled with oneOf validation which isn't currently supported without making a basic add-on to provide it.
Consider I have a json schema as below: .... { "properties" : { "minimumDelay" : { "type" : "number" }, "length" : { "type" : "number" }, }, "required": { "minimumDelay", "length" }
Here the json data will be valid if I enter both minimumDelay and length values.
But my requirement is json data must be valid when I enter either 1 of the values(like XOR case). How my schema must be modified to achieve the same?