I have mentioned two scenarios below, for which i want to generate a jsonschema. If the color
value is red
then redQuote
will be the required filed in the jsonschema. If it is black
then blackQuote
be the required filed. So required filed of the jsonschema is depend on color value. how we can use if'/'then'/'else'
keywords, or 'dependencies'
in draft-07 and 'dependentRequired' in draft2019-09
in this case?.
Example-1
{
"color": "red",
"quote": {
"is_apply": True,
"redQuote": "something"
}
}
Example-2
{
"color": "black",
"quote": {
"is_apply": True,
"blackQuote": "something"
}
}