1
我JSON模式是這樣的:JSON模式檢查所有項目枚舉存在於對象的數組
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array",
"items": {
"type": "object",
"properties": {
"country": {
"type": "string",
"maxLength": 2,
"enum": ["aa", "bb"]
}
},
"required": [
"country"
]
}
}
和JSON格式如下:
[
{"country": "aa"},
]
我想架構檢查是否JSON文件包含enum中列出的所有國家或地區:
[
{"country": "aa"},
{"country": "bb"},
]
是否有可能?
感謝您澄清這些事情) – xdrew