I’m trying to do a multi-conditional required array. It works when I use allOf
but of course that means all of my conditions need to be met. Rather, I need certain conditions to be met for certain fields. I do not want to make a custom renderer because this ought to be table-stakes.
"anyOf": [
{
"if": {
"properties": {
"veteran": {
"const": true
}
}
},
"then": {
"required": [
"veteran_unemployed"
]
}
},
{
"if": {
"properties": {
"snap": {
"const": true
}
}
},
"then": {
"required": [
"snap_benefits_extras_name",
"snap_benefits_before",
"snap_benefits_extras_city_state"
]
}
}
]