I have the following schema, and what I am trying to accomplish, is where I can have one or more of the following:
a1
but nota2
and vise versab1
but notb2
and vise versac1
but notc2
and vise versa
Here is the json schema that I am trying but it doesn't work:
{
"type": "object",
"properties": {
"action": {
"type": "object",
"properties": {
"a1": {},
"a2": {},
"b1": {},
"b2": {},
"c1": {},
"c2": {}
},
"anyOf": [
{
"oneOf": [
{"required": ["a1"]},
{"required": ["a2"]}
]
},
{
"oneOf": [
{"required": ["b1"]},
{"required": ["b2"]}
]
},
{
"oneOf": [
{"required": ["c1"]},
{"required": ["c2"]}
]
}
]
}
}
}
It is telling me that the following is valid json:
{
"action": {
"a1": {},
"b1": {},
"b2": {}
}
}
This shouldn't be valid because both b1
and b2
are set.