I have a JSON object as blow:
{
"a": {
"key1": "value1",
"key2": true
},
"b": {
"key3": "value3",
"key4": "value4" // make key4 required if the value of key2 is true, otherwise it should be optional
}
}
What I need is to make key4 required if the value of key2 is true, otherwise it should be optional. I know that JSON schema support optional required based on the value of keys within the same object. But in this case, what I need to base on the value of a key from another object.
.