{ "type": [ "object", "null" ], "properties": { "a_string": { "type": "string" } }, "additionalProperties": false }
The sample data
object = { "a_string": "this property is allowed by the schema", "an_extra_string": "the schema does not allow this property" }
Previously it does not raise any error
After the fix
Following error will throw
JSON::Schema::ValidationError: The property '#/' contains additional properties ["an_array"] outside of the schema when none are allowed
This fix should will resolve this issue #404
Given the following schema:
{ "type": [ "object", "null" ], "properties": { "a_string": { "type": "string" } }, "additionalProperties": false }
The sample dataobject = { "a_string": "this property is allowed by the schema", "an_extra_string": "the schema does not allow this property" }
Previously it does not raise any error
After the fix Following error will throw
JSON::Schema::ValidationError: The property '#/' contains additional properties ["an_array"] outside of the schema when none are allowed