How can I ensure that ID Number is unique in this array of objects ? I know uniqueItems will ensure the entire object is unique at the top level of the array but if any of the other settings are changed, the ID Number can be the same in multiple elements.
Is this possible with draft-07 ?
I think it may be impossible ? Is there some way to restructure it to solve it ?
{
"type": "object",
"properties": {
"Partition Data": {
"type": "array",
"uniqueItems" : true,
"items": {
"type": "object",
"properties": {
"ID Number": {
"type": "object",
"properties": {
"value": {
"type": "integer",
"minimum": 1,
"maximum": 4,
"default": 1
}
},
"required": [
"value"
]
},
"Name": {
"type": "object",
"properties": {
"value": {
"type": "string",
"maxLength": 16
}
},
"required": [
"value"
]
},
"Time Option 1": {
"type": "object",
"properties": {
"value": {
"type": "string",
"enum": [
"None",
"15 Seconds",
"30 Seconds",
"45 Seconds",
"60 Seconds",
"90 Seconds",
"2 Minutes",
"3 Minutes",
"4 Minutes"
],
"default": "30 Seconds"
}
},
"required": [
"value"
]
},
"Bool Option 2": {
"type": "object",
"properties": {
"value": {
"type": "boolean",
"default": true
}
},
"required": [
"value"
]
}
}
}
}
}
}
Some more reading... This link looks similar... it says that it cannot be done... really ? JSON schema deeper object uniqueness