I have this parent schema:
{
"definitions": {
"parcel": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"accountNumber": {
"type": "string"
},
"parcelNumber": {
"type": "string"
},
"propertyType": {
"type": "string"
},
"address": {
"$ref": "address.json#/definitions/address"
},
"coordinates": {
"$ref": "coordinates.json#/definitions/coordinates"
}
},
"required": ["accountNumber", "parcelNumber"]
}
}
}
Following are the referenced sub-schemas:
{
"definitions": {
"address": {
"type": "object",
"properties": {
"addressString": {
"type": "string",
"addressType": {
"enum": ["residential", "business"]
}
},
"required": ["addressString"]
}
}
}
}
{
"definitions": {
"coordinates": {
"type": "object",
"properties": {
"latitude": {
"type": "number"
},
"longitude": {
"type": "number"
},
"projection": {
"type": "string"
}
},
"required": ["latitude ", "longitude", " projection"]
}
}
}
I want to apply the following conditions to the parent schema.
- Either address or coordinates or both are provided.
- It should fail the validation if neither address nor coordinates is provided.