I have the following schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"choices": {
"type": "array",
"items": {
"type": "object",
"properties": {
"value": {
"type": "string"
},
"isCorrect": {
"type": "boolean"
}
},
"required": ["value", "isCorrect"],
"additionalProperties": false
},
"minItems": 1,
"maxItems": 50,
"uniqueItems": true,
"additionalItems": false,
}
}
}
Which validates data
{
"choices": [
{
"value": "John",
"isCorrect": true
},
{
"value": "Doe",
"isCorrect": true
}
]
}
But I want isCorrect to have a single true (others false) in the array of the objects.
Is it possible to validate the uniqueness on a single key?