I have a json object that can contain any number of nested objects with certain specification, for example:
{
"Bob": {
"age": "42",
"gender": "male"
},
"Alice": {
"age": "37",
"gender": "female"
}
}
And would like to have a schema looking something like:
{
"type": "object",
"propertySchema": {
"type": "object",
"required": [
"age",
"gender"
],
"properties": {
"age": {
"type": "string"
},
"gender": {
"type": "string"
}
}
}
}
I know that I can turn that into array and push 'name' inside the objects. In that case my schema would look like:
{
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"age",
"gender"
],
"properties": {
"name": {
"type": "string"
},
"age": {
"type": "string"
},
"gender": {
"type": "string"
}
}
}
}
but I would like to have a dictionary-like structure. Is it possible to make such schema?