-
-
Notifications
You must be signed in to change notification settings - Fork 336
Closed
Milestone
Description
This keyword indicates that the object must adhere strictly to the defined schema. That is, all defined properties required, and no additional properties allowed.
Example:
{
"type": "object",
"properties": {
"latitude": {
"type": "number"
},
"longitude": {
"type": "number"
}
},
"strict": true
}
Which would be equivalent to the following schema.
{
"type": "object",
"properties": {
"latitude": {
"type": "number"
},
"longitude": {
"type": "number"
}
},
"required": [
"latitude",
"longitude"
],
"additionalProperties": false
}
While not a huge issue in this trivial example, it would allow objects with many required properties to be expressed less verbosely, and allow for clearer communication of the author's intention.
ndench, gregsdennis, timbeadle, anatolebeuzon, dmazin and 20 more