开发者

enforce empty JSON schema

开发者 https://www.devze.com 2023-01-12 11:20 出处:网络
I want a JSON schema that enforces an empty JSON objec开发者_JAVA百科t, e.g. {} Is this a good idea and possible?

I want a JSON schema that enforces an empty JSON objec开发者_JAVA百科t, 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": {
    }
 }


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

0

精彩评论

暂无评论...
验证码 换一张
取 消