We often see two fields that depend on each other, i.e. the value of one field depends on the other.
For example:
Can we validate that? For example through a map? Does it make things to complicated?
How would that work in JSON Schema? A discussion in their Slack lead to the conclusion that the only reasonable way is anyOf:
anyOf: [
{properties: {name: {const: 1}, id: {const: "apple"}}},
{properties: {name: {const: 2}, id: {const: "peach"}}},
...
]
We often see two fields that depend on each other, i.e. the value of one field depends on the other.
For example:
Can we validate that? For example through a map? Does it make things to complicated?
How would that work in JSON Schema? A discussion in their Slack lead to the conclusion that the only reasonable way is
anyOf: