I’m trying to set the list of possible enum values for a field based on the selection of another enum using “AnyOf”, but not working:
"dataSource": {
"type": "string",
"enum": [
"storm_report",
"weather_report",
"site_attributes"
]
},
"attribute": {
"type": "string",
"enum": [
"total_snowfall",
"storm_start_date",
"storm_end_date",
"pre_storm_temp",
"post_storm_temp",
"site_type"
]
},
And then after all property definitions …
"oneOf": [
{
"properties": {
"data_source": {
"enum": [
"storm_report"
]
},
"attribute": {
"enum": [
"total_snowfall",
"storm_start_date",
"storm_end_date"
]
}
}
},
{
"properties": {
"data_source": {
"enum": [
"weather_report"
]
},
"attribute": {
"enum": [
"pre_storm_temp",
"post_storm_temp"
]
}
}
}
If I make the conditional enum “required” then it does seem to be VALIDATING against it, but it wont actually display ONLY the desired values.