Setting allowUnknownAttributes: false in settings causes Validator.validate to fail if the schema or a subschema uses the $id property, making the use of subschemas impossible in this case.
This can technically be worked around by using id instead of $id.
Expected result: not crashing, validating correctly
Actual result: crashes on line 5, SchemaError: Unsupported attribute: $id, schema: { '$id': '/Test', type: 'string' }
(this is not dependant on line 4 being present, but this shows that line 4 works as expected)
Setting
allowUnknownAttributes: false
in settings causesValidator.validate
to fail if the schema or a subschema uses the$id
property, making the use of subschemas impossible in this case. This can technically be worked around by usingid
instead of$id
.Minimal example:
Expected result: not crashing, validating correctly Actual result: crashes on line 5,
SchemaError: Unsupported attribute: $id
,schema: { '$id': '/Test', type: 'string' }
(this is not dependant on line 4 being present, but this shows that line 4 works as expected)Adding
$id: true
inlib/attribute.js
,attribute.ignoreProperties
seems to fix this.If needed, i can create a PR for this, but I don't know what to write for the tests as there doesnt seem to be any for
allowUnknownAttributes
yet.