------------Josn schema-----------
{
"type": "object",
"properties": {
"street_address": {
"type": "string"
},
"city": {
"type": "string"
},
"state": {
"type": "string"
}
},
"required": [
"street_address"
],
"additionalProperties": false
}
In above schema i want to create a choice between city and state. That is either city or state can come in json. So that below json would be invalid
{
"street_address": "abc",
"city": "anv",
"state": "opi"
}
and below one should be valid one
{
"street_address": "abc"
}
or
{
"street_address": "abc",
"city": "anv"
}
or
{
"street_address": "abc",
"state": "opi"
}
Can some one please help me to modify above schema to accomplish the goal.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…