-
-
Notifications
You must be signed in to change notification settings - Fork 582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancing best_match through by sorting the type of error #728
Comments
Hey Julian, would you be able to comment on why PR 738 was closed. I appreciate that you may want to do this differently, or that there is some other refactoring in place which would break this. Just looking to understand the current status. Thanks for you time. |
Oy. Sorry @miquelougoogle it's actually nothing of the sort. I had finished the move of jsonschema's main branch to be called "main" (instead of "master") and deleted the master branch, and I always forget that GitHub does not let you change the target branch of a PR, so it's gone and closed all of the ones that were targeting master and won't let me reopen them. Apologies for the mixup, there's definitely nothing more to it, fully intend to merge that PR if we get it over the finish line! |
Ah ! All clear, thanks for the quick reply ! I've re-created the PR to point on the new default branch (main). |
This issue is a follow up on issue 698.
The feature request, describes how to enhance the best_match function in order to prioritize the
type
of the rule with thetype
of the instance. Example : if an array is presented in an instance, array related rules should be prioritized against other type of rules.As shown in the following example, this currently isn't reliable :
The rule :
With :
Expected result (OK) :
Current result :
With :
Expected result (OK) :
Current result
With :
Expected result (NOK) :
Current result :
On the implementation of such feature, I believe if we were to add a field on
_Error
to capture if the rule is of thesame_type
as the instance, and then changing the return function ofby_relevance
by adding theerror.same_type
on the tuple being returned, would solve that issue.I just had a look on how to do it, there are probably better ways of doing this, I am not familiar with the code base.
The text was updated successfully, but these errors were encountered: