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
It seems that in version 4.1.1, JSON::Validator#validation_errors always returns []. I think it's due to the @errors attribute being reset during validation:
We previously used validation_errors to get to the error objects and be able to call .message on them, which yields a nicer error message for anonymous schemas (without URI). Now that seems no longer possible, and in addition the validation_errors method seems useless.
The text was updated successfully, but these errors were encountered:
Our problem would be solved by either restoring the way record_errors worked before, or adding an option that makes validate return the error objects, or by adding an option to omit the (generated) schema URI from the error messages.
I'm happy to put up a PR but am not sure which solution is preferred.
It seems that in version 4.1.1,
JSON::Validator#validation_errors
always returns[]
. I think it's due to the@errors
attribute being reset during validation:json-schema/lib/json-schema/validator.rb
Line 126 in 76ea712
To reproduce:
We previously used
validation_errors
to get to the error objects and be able to call.message
on them, which yields a nicer error message for anonymous schemas (without URI). Now that seems no longer possible, and in addition thevalidation_errors
method seems useless.The text was updated successfully, but these errors were encountered: