Friendlier unevaluatedProperties
errors
#1074
Labels
Enhancement
Some new desired functionality
Error Reporting
Issues related to clearer or more robust validation error reporting
It would be helpful to bifurcate the "Unevaluated properties are not allowed" error messages over whether the property was expected — defined but failing validation, e.g.
"Unevaluated properties are not allowed ('foo', 'bar' were not valid under the given schema)"
"Unevaluated properties are not allowed ('baz' was unexpected)"
A single
unevaluatedProperties
could yield 0, 1 or 2 errors.I personally found that aspect of
unevaluatedProperties
to be confusing when I first stumbled on it ("foo
is not a typo, so why is it reported?"). Later I understood it, but my learning path could be shorter and astonishment smaller if we somehow structured the message to suggest this possibility.--
One way to implement this would be to have
find_evaluated_property_keys_by_schema
collect tuples of(property_name, is_valid)
, and then process them withinunevaluatedProperties
:Then
unevaluated_keys
could be split into:and each list used to emit the relevant error message.
The text was updated successfully, but these errors were encountered: