If you want to have only a specific set of properties in JSON objects and refuse to others:
- make sure you have the appropriate schema in
properties and patternProperties , define additionalProperties - false :
{ "type": "object", "properties": { "p": {}, "q": {} }, "additionalProperties": false }
will only allow p and q in instances of objects.
source share