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
Proper handling of parameterized types in RestTemplate [SPR-7023] #11685
Comments
Fotios Lioutsis commented I am using version 3.0.3.RELEASE and found that the description above works (since #11667 is resolved). However there is no support for usage of RestTemplate getForObject with a Jackson JavaType instead. Passing responseType object as List.class does not use generics (like List<MyDomain> as response type argument in your example). There should be support as in ObjecMapper method: |
Fotios Lioutsis commented Clarification to the above comment: it is still failing with ClassCastException unless the workaround of #11667 is used. |
Jay Xu commented This scenario exposes the limitation of type-erasing of Java generic handling. Looking forward to solution |
Mukta commented Is a fix for this planned in any of the upcoming releases? |
Rossen Stoyanchev commented Commit ed3823b045fd19cdb801609eb034c93dd4d75c3f:
|
Arjen Poutsma opened SPR-7023 and commented
Currently, the RestTemplate has no way to handle generic types. In other words, the following does not work:
This should be fixed.
Affects: 3.1.1
Issue Links:
Referenced from: commits ed3823b
14 votes, 16 watchers
The text was updated successfully, but these errors were encountered: