我有一个无序的JSON项array.根据规范https://datatracker.ietf.org/doc/html/draft-zyp-json-schema-03#section-5.5,下面的JSON模式将仅验证数组中的对象是否以该顺序出现.我不想指定顺序,只需验证数组中的对象,而不考虑对象的顺序或数量.从说明书上看,我似乎不明白这是怎么做的.
"transactions" : {
"type" : "array",
"items" : [
{
"type" : "object",
"properties" : {
"type" : {
"type" : "string",
"enum" : ["BUILD", "REASSIGN"]
}
}
},
{
"type" : "object",
"properties" : {
"type" : {
"type" : "string",
"enum" : ["BREAK"]
}
}
}
]
}