Skip to content

Conversation

dberrueta-atlassian
Copy link

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.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 24, 2019
@wilkinsona wilkinsona added the type: enhancement A general enhancement label Apr 24, 2019
@wilkinsona wilkinsona added this to the 2.2.x milestone Apr 24, 2019
@dberrueta-atlassian dberrueta-atlassian marked this pull request as ready for review April 24, 2019 12:13
/**
* Integration tests for {@link GsonTester}. Shows typical usage.
*
* @author Andy Wilkinson

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 {

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.

@dberrueta-atlassian
Copy link
Author

I took @wilkinsona 's suggestion from #15735 (comment) and in this new PR I limit the change just to JacksonTester, which was the only tester for which I had observed an asymmetric behaviour.

@wilkinsona wilkinsona changed the title Configure coordinated JSON provider in json-path. Fixes gh-15727 JacksonTester handles some characters asymmetrically Apr 24, 2019
@wilkinsona wilkinsona added type: bug A general bug and removed type: enhancement A general enhancement labels Apr 24, 2019
@wilkinsona
Copy link
Member

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.

@wilkinsona wilkinsona added the for: team-attention An issue we'd like other members of the team to review label Apr 24, 2019
@wilkinsona wilkinsona modified the milestones: 2.2.x, 2.1.x Apr 24, 2019
@wilkinsona wilkinsona self-assigned this Apr 24, 2019
@wilkinsona wilkinsona removed the for: team-attention An issue we'd like other members of the team to review label Apr 24, 2019
philwebb pushed a commit that referenced this pull request Apr 25, 2019
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
philwebb added a commit that referenced this pull request Apr 25, 2019
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
@philwebb philwebb closed this in 7302974 Apr 25, 2019
@philwebb philwebb modified the milestones: 2.1.x, 2.1.5 Apr 25, 2019
@wilkinsona wilkinsona removed the status: waiting-for-triage An issue we've not yet triaged label Apr 25, 2019
@philwebb
Copy link
Member

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!

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

Successfully merging this pull request may close these issues.

Use of json-path's default JsonSmartJsonProvider introduces asymmetric handling of special characters
5 participants