Is it possible to set up a JSON schema that still allows for additionalProperties
but does not match if a very particular property name is present? In other words, I need to know if it's possible to have the exact opposite of the required
declaration.
Schema:
{
"type": "object",
"properties": {
"x": { "type": "integer" }
},
"required": [ "x" ],
"ban": [ "z" ] // possible?
}
Match:
{ "x": 123 }
Match:
{ "x": 123, "y": 456 }
Do not match:
{ "x": 123, "y": 456, "z": 789 }
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…