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?
c++
related?embedded
related? Please find some more relevant tags. Also, you seem to be trying to use JSON as some kind of general purpose programming language with control flow operators. This seems.... unusual, to me. This is not how JSON is normally used.