尝试创建以下 JSON 的架构。
{
"peopleNames": [
{
"name": "John Doe",
"Address": "10th Street, Chicago, WI",
"jobInformation": {
"employers": [
"ABC",
"ChocolateFactory"
]
},
"employers": {
"ABC": {
"employeeID": "1234"
},
"ChocolateFactory": {
"employeeID": "4567"
}
}
},
{
"name": "Jamie Soe",
"Address": "110th Street, Seattle, WA",
"jobInformation": {
"employers": [
"McDonalds",
"RedRobin"
]
},
"employers": {
"McDonalds": {
"employeeID": "1234"
},
"RedRobin": {
"employeeID": "4567"
}
}
}
]
}
“employers”的属性取决于 jobInformation.employers 列表的值。雇主的价值不依赖于任何枚举,可以是随机的。我需要验证雇主的价值是否与 jobInformation.employers 具有相同的属性。
我不明白我怎么能做到这一点。提前致谢。