additionalProperties and additionalItems

56 views
Skip to first unread message

Jack Wootton

unread,
Jan 9, 2018, 9:51:48 AM1/9/18
to json-...@googlegroups.com
Hi,

The latest spec defines additionalProperties as:

The value of "additionalProperties" MUST be a valid JSON Schema.

Historically additionalProperties use to be a boolean,

additionalProperties: true | false 

My understanding is that it then became boolean for false OR a valid JSON Schema:

additionalProperties: false
 
additionalProperties: { type: "string" }

The latest spec states that it may now only be a valid JSON Schema.

Questions.

If only valid schema is allowed, how does one denote no additional schemas?

Best,
Jack

Henry Andrews

unread,
Jan 9, 2018, 11:18:02 AM1/9/18
to json-...@googlegroups.com
Hi Jack,
  If you take a look at the latest JSON Schema Core spec you will see that booleans are now considered valid JSON Schemas and may appear anywhere a schema object can appear.  true is equivalent to {}, and false is equivalent to {"not": {}}.  So "additionalProperties" and "additionalItems" have not changed, they're just not special cases anymore.

thanks,
-henry



From: Jack Wootton <jackw...@gmail.com>
To: json-...@googlegroups.com
Sent: Tuesday, January 9, 2018 6:51 AM
Subject: [json-schema] additionalProperties and additionalItems

--
You received this message because you are subscribed to the Google Groups "JSON Schema" group.
To unsubscribe from this group and stop receiving emails from it, send an email to json-schema...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Reply all
Reply to author
Forward
0 new messages