Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

enforce empty JSON schema

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": {
    }
 }
like image 876
AwkwardCoder Avatar asked Aug 19 '10 11:08

AwkwardCoder


1 Answers

The answer yes this should enforce an empty schema - the validator I was using had a bug

http://groups.google.co.uk/group/json-schema/browse_thread/thread/d0017b3985c8542b/106ce4afc1763eeb?hl=en&q=empty+schema+ollie&safe=on

like image 189
AwkwardCoder Avatar answered Oct 04 '22 02:10

AwkwardCoder