What is the difference between “required” vs “optional” in JSON Schema

The IETF draft v4 of the JSON schema
only defines required and does not include optional.

To quote the section on required from draft v4:

Valid values: The value of this keyword MUST be an array. This array MUST have
at least one element. Elements of this array MUST be strings, and MUST be
unique.

Conditions for successful validation: An object instance is valid against this
keyword if its property set contains all elements in this keyword’s array
value.

In effect, using required makes optional all properties for which
the name is not included in the given array of strings.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)