I have a configuration file as json with some numerical attributes that have min and max constraints in order to set a range of valid values. Using a json schema validator was easy and quick to validate the configuration file, but now I have a new set of attributes which valid ranges depends on the value of other attribute.
For example:
foo: [10, 20]
bar: [foo*0.6, foo*0.8]
If foo is set to 15, valid values for bar are from 9 to 12.
The only thing I could manage to find is the if-then-else function but it doesn't solves my issue.
Is there a way I could do something like this?
"foo": {
"type": "integer",
"minimum": 10,
"maximum": 20
},
"bar": {
"type": "integer",
"minimum": 0.6*foo,
"maximum": 0.8*foo
}
I think the answer most probably must be no and I should do that validation externally, but if I can kill two birds with one stone...
Thanks in advance.