Reputation: 25
I have bunch of enum, and they all have required field, some of then would have same then{}, so I wonder if there is a way to do a "or" inside of if, instead have bunch of if-then.
"if":{
a or b
},
"then":{
c
}
instead of
"if":{
a
},
"then":{
c
},
"if":{
b
},
"then":{
c
}
Upvotes: 0
Views: 44
Reputation: 24489
anyOf
is a logical OR operation. You can do something like this.
"if": {
"anyOf": [a, b]
},
"then": {
c
}
Upvotes: 1