Hi,
I want to make one of two properties required. Here is an example instance:
"MetadataBoolean": {
"type": "object",
"properties": {
"@DEF": {
"type": "string"
},
"@USE": {
"type": "string"
},
"IS": {
"$ref": "#/definitions/IS"
},
"@name": {
"type": "string"
},
"@reference": {
"type": "string"
},
"@value": {
"type": "array",
"minItems": 1,
"items": {
"type": "boolean"
}
},
"-metadata": {
"$ref": "#/definitions/-metadata"
},
"-children": {
"$ref": "#/definitions/-commentRoute"
}
},
"required": [
"@name"
],
"additionalProperties": false
},
At the moment, only the "@name" property is required. I want to modify the schema so that either the "@name" or the "@USE" properties are required. I suspect that "oneOf" is the solution, but I don't know how to apply it, other than putting "oneOf" at the top and having the two alternatives for the full schema subset. Any help to arrive at a shorter solution would be appreciated.
Thanks in advance,
Roy