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
When looking at the way jsonschema.exceptions.best_match works to figure out a way to better interpret jsonschema errors, I was mislead by what I believe to be a wrong comment.
-len(error.path), # 'deeper' and thereby more specific
error.path, # earlier (for sibling errors)
In line 412, you're saying errors which are deeper (i.e., longer path) are preferred but the code is actually doing the opposite. It prefers errors with shorter paths. Am I correct? This behavior would be in line with the documentation of the best_match function:
When looking at the way
jsonschema.exceptions.best_match
works to figure out a way to better interpret jsonschema errors, I was mislead by what I believe to be a wrong comment.jsonschema/jsonschema/exceptions.py
Lines 411 to 413 in d47db26
In line 412, you're saying errors which are deeper (i.e., longer path) are preferred but the code is actually doing the opposite. It prefers errors with shorter paths. Am I correct? This behavior would be in line with the documentation of the
best_match
function:jsonschema/jsonschema/exceptions.py
Lines 438 to 440 in d47db26
The text was updated successfully, but these errors were encountered: