You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 using
id
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.The text was updated successfully, but these errors were encountered: