additionalProperties is your keyword:
{
"type" : "object",
"additionalProperties" : {
"type" : "object",
"required" : [
"age",
"gender"
],
"properties" : {
"age" : {
"type" : "string"
},
"gender" : {
"type" : "string"
}
}
}
}
additionalProperties can have the following values with different meanings:
"additionalProperties": falseNo more properties are allowed at all."additionalProperties": trueOther properties are allowed. This is the default behavior."additionalProperties": {"type": "string"}Additional properties (of arbitrary name) are allowed, as long as their value follows the given type ("string"here)."additionalProperties": {*any schema*}Additional properties must satisfy the provided schema, such as the example provided above.