Trying to create a schema of the below 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"
}
}
}
]
}
The properties of "employers" is dependent on the value of the jobInformation.employers list. The value of employers are not dependent on any enum and can be random. I need to validate that the value of employers has the same properties as the jobInformation.employers.
I dont understand how I can achieve that. Thanks in advance.