-
Notifications
You must be signed in to change notification settings - Fork 685
In a @JsonPath projection a List<interface> property always returns a list with only one element #2270
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
Comments
I was able to reproduce the issue by using |
Okay, so the actual path definition makes the difference, whether the path is definite or not. Only definite paths lead to additional list wrapping. Can you provide a sample for your input JSON? |
Yes of course, here is a sample:
|
Okay, thanks. The combination of a scan token with an array response leads to a non-definite path and therefore the JSON path library doesn't wrap the response in a nested list. Checking for a non-definite path and then applying the proper collection handling in combination with checking the return type does the trick. |
We now check for double-nesting of JSON path evaluation results when the return type is a collection. If the result is double-wrapped and the nested object is a collection then we unwrap it. Closes #2270
Reuse definitive path flag without recompile the expression. See #2270
We now check for double-nesting of JSON path evaluation results when the return type is a collection. If the result is double-wrapped and the nested object is a collection then we unwrap it. Closes #2270
Reuse definitive path flag without recompile the expression. See #2270
Reuse definitive path flag without recompile the expression. See #2270
The
@JsonPath
projection of a List of an interface type returns only the first element even if the list should contain more elements.The following code hopefully makes the circumstances clear.
Responsible for the error is the following code in
InputMessageProjecting.invoke
:The text was updated successfully, but these errors were encountered: