我需要根据http://json-schema.org/定义的规范编写 JSON Schema 。但我正在为必需/强制性的属性验证而苦苦挣扎。下面是我编写的 JSON 模式,其中所有 3 个属性都是强制的,但在我的情况下,任何一个都应该是强制的。这个怎么做?。
{
"id": "http://example.com/searchShops-schema#",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "searchShops Service",
"description": "",
"type": "object",
"properties": {
"city":{
"type": "string"
},
"address":{
"type": "string"
},
"zipCode":{
"type": "integer"
}
},
"required": ["city", "address", "zipCode"]
}