Is it possible to have either option A or B, but not both (mutually exclusive)?
In Draft 3, I am required to use whatever is available, even though the version on top says 4. This is because when using an array for "required", it throws an error stating that it cannot convert an array to a boolean. If arrays are removed without specifying the use of draft 4, Newtonsoft.Json.Schema.Extensions::IsValid does not validate properly and returns "true" randomly.
Unfortunately, I must utilize an outdated version of Newtonsoft.
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "",
"type": "object",
"additionalProperties": false,
"properties": {
"SearchCriteria": {
"type": "array",
"uniqueItems": true,
"minItems": 1,
"required": true,
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"A": {
"type": "string",
"minLength": 1,
"pattern": "^[^\\s]*$"
},
"B": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"pattern": "^[^\\s]*$",
"enum": ["One", "Two"]
},
"minItems": 1
},
"C": {
"type": "string",
"required": true,
"minLength": 2
},
"D": {
"type": "array",
"required": true,
"items": {
"type": "string"
},
"minItems": 1,
"uniqueItems": true
}
}
}
}
}
}