enforce empty JSON schema
-
29-09-2019 - |
Question
I want a JSON schema that enforces an empty JSON object, e.g. {}
Is this a good idea and possible?
I tried the following but it allows me to enter anything in the JSON body:
{
"description": "voice mail record",
"type": "object",
"additionalProperties": false,
"properties": {
}
}
Solution
The answer yes this should enforce an empty schema - the validator I was using had a bug
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow