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

2.7.0 SUPPRESS_EXCEPTIONS not backwards compatible with 2.6.0 #951

Open
Bonnev opened this issue Jul 31, 2023 · 3 comments
Open

2.7.0 SUPPRESS_EXCEPTIONS not backwards compatible with 2.6.0 #951

Bonnev opened this issue Jul 31, 2023 · 3 comments

Comments

@Bonnev
Copy link

Bonnev commented Jul 31, 2023

In addition to #840 the following code works fine (no errors) on 2.6.0 but throws an exception on 2.7.0:

Object value = JsonPath
	.using(Configuration.defaultConfiguration()
		.setOptions(Option.SUPPRESS_EXCEPTIONS, Option.DEFAULT_PATH_LEAF_TO_NULL))
	.parse("{\"random\":{\"test1\": 4}, \"mandom\":{\"test2\": 10}}")
	.read("$..test.max()");
System.out.println(value);
@marchof
Copy link

marchof commented Sep 4, 2023

Looks like this was broken in this PR #775.

@5Orange
Copy link

5Orange commented Dec 17, 2023

Same #908

@mpassell
Copy link

mpassell commented Mar 12, 2024

@kallestenflo I just hit this issue as well when trying to upgrade from v2.6.0 to v2.7.0+ (v2.9.0, to be specific). Based on how JsonPath.handleMissingPathInContext() was implemented, it can cause a different type to be returned by JsonPath.put(), which then causes a ClassCastException in JsonContext.put(). Based on that, I don't see how I can restore the behavior I had in v2.6.0 no matter which Options I enable.

I think that the changes in #871 would fix this for me if you could merge that. If not, but there was a way to make a v2.6.1 with the vulnerability fix in v2.9.0, that would be great.

Edit: If I were to cherry-pick the commit(s) from #985 and create a PR against the 2.6.0 tag/branch, would that be helpful?

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

No branches or pull requests

4 participants