Skip to content
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

suppress exception when evaluate a json path. #909

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mswindowsxp
Copy link

@mswindowsxp mswindowsxp commented Mar 26, 2023

the Option.SUPRESS-EXCEPTION is not working in this case : #908
var node = objectMapper.readTree("{"test" : null}");

JsonPath.using(Configuration.builder()
    .options(Option.SUPPRESS_EXCEPTIONS).build())
    .parse(node.toString())
    .read("$.test[?(@ != null)]");

the Option.SUPRESS-EXCEPTION is not working in this case   :
var node = objectMapper.readTree("{\"test\" :  null}");

    JsonPath.using(Configuration.builder()
        .options(Option.SUPPRESS_EXCEPTIONS).build())
        .parse(node.toString())
        .read("$.test[?(@ != null)]");
@mswindowsxp
Copy link
Author

mswindowsxp commented Mar 29, 2023

@kallestenflo could you please take a look ? #908

@lordshelbyss
Copy link

With 2.6.0 versions and below, this would return an empty list.
But now it throws the above exception. Will the fix entail that an empty list be returned along with exceptions being supressed ?

@mswindowsxp
Copy link
Author

With 2.6.0 versions and below, this would return an empty list.
But now it throws the above exception. Will the fix entail that an empty list be returned along with exceptions being supressed ?

That fix same as the 2.6 version. It will return an empty list when “suppress exception” is true. Let me know what I need to update if I'm missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants