是否有任何方法可以将模式未描述的属性纳入标准。例如这个架构:
{
"description": "foo and bar",
"type": "object",
"properties": {
"foo": {
"type": "number"
},
"bar": {
"type": "string",
"enum": [
"a",
"b",
"c"
]
}
}
}
将传递这个 JSON:
{
"foo": 12345,
"bar": "a",
"baz": 12312
}
尽管它具有baz
不属于模式的属性。
UPD:到目前为止,我正在使用tv4库。