So, I’ve got a json that has a handful of initial values, but as a user story I need to allow adjustments per point/object rather than at the top.
{"properties":{
"p1":{},
"p2":{},
"pollInterval":{},
"contents":{
"anyOf":[{
"properties":{
...
},{
...
}
}]
}
}
Here I want to require that if pollInterval is not in the initial properties, it has to be required in either of the anyOf properties blocks. I have the pollInterval definition of both anyOf blocks, though not they are not strictly required like some of the other data. I am just unsure of where to put it. Currently, I have it below the anyOf block as
if":{
"not":{
"properties":{
"pollInterval":{}
}
}
},
"then":{
"required":
{
}
},
But it doesn’t seem to force the pollInterval if I remove pollInterval from the top. How can I fix this?
Adam Chiarella is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.