我是关于 npm ajv 的新手
我有一个问题:对象 json 中有多少个“开关”?例子:
var schema = {
"type": "object",
"switch": [
{
"if": {
"properties": {
"powerLevel": {"constant": false}
}
},
"then": {
"required": ["disbelief"]
}
},
{
"then": {
"required": ["confidence"]
}
}
],
"switch": [
{
"if": {
"properties": {
"power": {"constant": false}
}
},
"then": {
"required": ["disb"]
}
},
{
"then": {
"required": ["conf"]
}
}
]
};
我在此链接中使用上面的架构进行测试
它只是检查结束开关。请帮我!谢谢!