-
Notifications
You must be signed in to change notification settings - Fork 41.5k
JacksonTester handles some characters asymmetrically #16629
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
Conversation
/** | ||
* Integration tests for {@link GsonTester}. Shows typical usage. | ||
* | ||
* @author Andy Wilkinson |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wilkinsona I hope you don't mind I attributed this file to you. You provided part of the code in #15735 (comment)
} | ||
|
||
@Test | ||
public void stringLiteral() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same test than for Gson, just to confirm that there isn't a similar regression when using Jackson.
I took @wilkinsona 's suggestion from #15735 (comment) and in this new PR I limit the change just to |
Given that this is a bug and the fix appears to be reasonably low-risk, I'm tempted to fix this in 2.1.x. Flagging for team attention to see what everyone else thinks. |
Update `JacksonTester` so that the JsonPath instance is explicitly configured with both a `JacksonJsonProvider` and a `JacksonMappingProvider`. Prior to this commit, the handling of special characters was not symmetrical between the serialization (handled via the JacksonTester) and the parsing (handled via JsonPath) due to the fact that JsonPath used `SimpleJson` as its parser. See gh-16629
Polish contribution to use a factory method in `AbstractJsonMarshalTester` rather than additional constructor arguments. Also change the `JsonContent` tests so that the `Configuration` constructor is package private. This keeps JsonPath classes out of our public API, at the expense of limiting custom JsonPath configurations to just our code. See gh-16629
I forgot to comment here yesterday. This is now merged into 2.1.x and master along with a polish commit. Thanks very much @dberrueta-atlassian for the PR! |
This fixes #15727 by customising the json-path configuration for each {Jackson|Gson|BasicJson}Tester. It also adds integration tests.
This PR replaces #15735 . It is essentially a squashed version of that one.