Let's take a simple example when we define objects and use them separately within JSON. For instance, we define several addresses and use them to define several routes:
{
"points": [
{
"Name": "p1",
"Street": "street1",
"House": 11,
"Ap": 111
},
{
"Name": "p2",
"Street": "street2",
"House": 22,
"Ap": 222
},
{
"Name": "p3",
"Street": "street3",
"House": 33,
"Ap": 333
},
{
"Name": "p4",
"Street": "street4",
"House": 44,
"Ap": 444
},
{
"Name": "p5",
"Street": "street5",
"House": 55,
"Ap": 555
}
],
"routes": [
[
"p1",
"p2",
"p3",
"p4"
],
[
"p3",
"p2",
"p1"
],
[
"p4",
"p2",
"p3",
"p1"
]
]
}
What would be a right way, if any, to validate with JSON schema, that all routes refer to defined addresses? Sorry if my question is too newbie.
Thanks,
question from:
https://stackoverflow.com/questions/66066787/json-schema-reference-enum-like-a-reference-to-array 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…