I have following JSON data:
[
{
"unique1":{
"value":3
}
},
{
"unique2":{
"value":4
}
}
]
Each array item has a json object with one top level unique key. When i try to write a validation schema for it I can only validate that the full array is unique but not the top level key in each array.
{
"$schema": "http://json-schema.org/draft-06/schema#",
"type": "array",
"uniqueItems": true,
"items": {
"type": "object",
"patternProperties": {
"^.*$": {
}
}
}
}
Following JSON data should fail to validate:
[
{
"unique1":{
"value":3
}
},
{
"unique1":{
"value":4
}
}
]