我正在尝试创建一个JSON Schema验证器,它根据给定JSON中的另一个判断一个值是否有效
schema = {
"foo": {"type": "boolean"},
"bar": {
"type": "object", "properties": {
"measurements":
{ "type": "object", "properties": {
"x" : { "type": "number"}, #"required": "ONLY IF FOO is TRUE"
"y" : { "type": "number"}
}
}
}
这有可能吗?