我使用的是json模式,希望只允许该文件中声明的属性通过验证.例如,如果用户在json对象中传递一个"name"属性,它将使该模式失败,因为"name"在这里没有作为属性列出.
Is there some function similar to "required" that will only allow the listed properties to pass?
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Accounting Resource - Add Item",
"type": "object",
"properties": {
"itemNumber": {
"type":"string",
"minimum": 3
},
"title": {
"type":"string",
"minimum": 5
},
"description": {
"type":"string",
"minimum": 5
}
},
"required": [
"itemNumber",
"title",
"description"
]
}