-
Notifications
You must be signed in to change notification settings - Fork 737
Diagnostics are poor when a wildcard is used with beneathPath and the identified field doesn't exist everywhere in the payload #715
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
Labels
type: bug
A bug
Milestone
Comments
I can't reproduce the problem described in #714. This test passes: @Test
public void extractMapSubsectionWithVaryingStructureFromInconsistentJsonMap()
throws JsonParseException, JsonMappingException, IOException {
this.thrown.expect(PayloadHandlingException.class);
this.thrown.expectMessage(
"The following non-optional uncommon paths were found: [*.thread.content, *.thread.count]");
new FieldPathPayloadSubsectionExtractor("*.thread").extractSubsection(
"{ \"number\":\"123\", \"link\":{ \"scheme\":\"scheme\", \"url\":\"url\" }, \"chat\":{ \"message\":\"send message\", \"id\":\"id\", \"thread\":{ \"content\":\"thread content\", \"count\":1 } } }"
.getBytes(),
MediaType.APPLICATION_JSON);
} @ddaaac Can you please provide a complete and minimal sample that reproduces the error message that you reported in #714? |
In my PR 71577e6, there is a test case. With some modifications to this case, following case would be not work.
|
wilkinsona
added a commit
that referenced
this issue
Nov 17, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See #714 for some background. When a field path containing a wildcard is used with
beneathPath
and the field doesn't exist everywhere in the payload, the resulting error message is the following:An error explaining that the identified sections of the payload do not have a common structure should be thrown instead.
The text was updated successfully, but these errors were encountered: