Closed nine closed 1 year ago
Observed behavior
The validation of following Json schema using the $ref keyword always returns true.
$ref
{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Schedule", "type": "object", "properties": { "reply": { "description": "Send reply", "type": "boolean" }, "schedule": { "description": "Array with schedule entries", "type": "array", "items": { "$ref": "#/definitions/schedule_entry" } } }, "definitions": { "schedule_entry": { "type": "object", "required": [ "id", "startdate", "cmd", "settings" ], "properties": { "id": { "type": "string" }, "startdate": { "type": "number", "minimum": 0 }, "cmd": { "type": "string" }, "settings": { "type": "object" } } } } }
Tested with
{ "reply": false, "schedule": [ { "id": "abc", "startdate": 1, "cmd": "foo", "settings": {} } ] }
{ "foo": "bar" }
Expected behavior
The validation of the second Json instance should return false.
Steps to reproduce A unit test for the bug is available in #219.
Discovered missing "required" array that caused wrong expectations on validation behavior. json-schema-validator works as expected!
Observed behavior
The validation of following Json schema using the
$ref
keyword always returns true.Tested with
Expected behavior
The validation of the second Json instance should return false.
Steps to reproduce A unit test for the bug is available in #219.