You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Jackson 2.6: message converter should use type also for Iterable [SPR-13523] #18100
This question makes perfectly sense, but here I think we have to align with Jackson 2.6 behavior (see this commit), so we have to use exactly the same condition than them to enable this functionality, or that will not work as expected.
I think my proposal would be to ask on Jackson side first if they can support that for all iterables.
If they do, we could then enable this on our side, but currently I tend to think we can't extend the support to all iterables.
I get type info in the json output. Jackson uses a IterableSerializer for this case. And this serializer does support type info (IterableSerializer:106):
I have tried to reproduce the issue but it seems that even if we don't pass the type information to ObjectMapper, for Iterable Jackson is able to find the type of each Iterable element (not the same behavior than List, Map, etc.). See TypeFactory#findTypeParameters()) and this test that passes with actual 4.2.2-BUILD-SNAPSHOT.
Did you guess this issue from reading the source code, or did you reproduce it in within a test case/project?
If you are able to reproduce it, could you provide a failing test case or a repro project that demonstrates the issue?
Activity
spring-projects-issues commentedon Sep 30, 2015
Sébastien Deleuze commented
This question makes perfectly sense, but here I think we have to align with Jackson 2.6 behavior (see this commit), so we have to use exactly the same condition than them to enable this functionality, or that will not work as expected.
I think my proposal would be to ask on Jackson side first if they can support that for all iterables.
If they do, we could then enable this on our side, but currently I tend to think we can't extend the support to all iterables.
Any thoughts?
spring-projects-issues commentedon Oct 1, 2015
Michael Schoene commented
Jackson 2.6.1 has support for Iterable. Using the following code
I get type info in the json output. Jackson uses a IterableSerializer for this case. And this serializer does support type info (IterableSerializer:106):
spring-projects-issues commentedon Oct 1, 2015
Sébastien Deleuze commented
Thanks for your feedback.
I have tried to reproduce the issue but it seems that even if we don't pass the type information to
ObjectMapper, forIterableJackson is able to find the type of eachIterableelement (not the same behavior thanList,Map, etc.). SeeTypeFactory#findTypeParameters()) and this test that passes with actual 4.2.2-BUILD-SNAPSHOT.Did you guess this issue from reading the source code, or did you reproduce it in within a test case/project?
If you are able to reproduce it, could you provide a failing test case or a repro project that demonstrates the issue?
spring-projects-issues commentedon Oct 26, 2015
Sébastien Deleuze commented
Hi Michael Schoene, could you please send me your feedback about how to reproduce the issue?