-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Revise AbstractJackson2HttpMessageConverter's generic type adaptation [SPR-13728] #18301
Comments
Juergen Hoeller commented Sébastien Deleuze, we have a few reports in the meantime which individually point out the incompatibility with Jackson 2.7. Let's prioritize this and aim for early availability in 4.3 snapshots... Juergen |
Sébastien Deleuze commented I have made some tests but this is not obvious to me how to achieve the same thing with Jackson 2.7 for some parameterized controller use cases (like the one tested in HttpEntityMethodProcessorTests#resolveArgumentTypeVariable), so I have asked for some feedbacks on Jackson bugtracker. |
Sébastien Deleuze commented The removal of That said, in Spring 4.3 I plan to update our current implementation of |
Sébastien Deleuze commented This draft commit fixes our remaining failing unit tests, and I have asked for a feedback to Jackson lead developer. Jackson 2.6 and 2.7 have different API for type resolution, so I wrapped version specific code in private classes. We need to wait the upcoming Jackson 2.7.1 release in order to be able to compile the Jackson 2.6 specific code. |
Juergen Hoeller commented Sébastien Deleuze, it looks like we could simply process the Juergen |
Sébastien Deleuze commented Juergen Hoeller Thanks your detailed feedback, I was not sure. Glad this is possible, that will make the change less intrusive. |
Sébastien Deleuze commented It seems we are going to need to revisit our |
Sébastien Deleuze commented I had more thoughts about this issue and as described by Tatu Saloranta, it seems that like in Jackson case, with the current parameters That said, the If we chose to keep our current API and behavior, I will update the implementation of my draft commit, since it currently breaks some use cases. It will have to go through the various inheritance level to find the right information I guess. Any thoughts about that Juergen Hoeller? |
Juergen Hoeller commented Sounds alright to me, Sébastien Deleuze. We didn't have an actual issue with type resolution on our end, and we're dealing with a rather narrow case: Spring MVC handler method arguments. So from my perspective, we should be fine with an algorithm that mimics what Jackson 2.6 did; ideally without calling any deprecated methods. Juergen |
Sébastien Deleuze commented I have implemented in this updated draft commit something close to what jackson 2.6 did for It works fine with our current tests but I would be interested by your feedback Juergen Hoeller, since |
Juergen Hoeller commented Sébastien Deleuze, this looks alright for a start. We might roll that algorithm into a dedicated method on In any case, let's get it into master as-is and see whether we have any integration test failures. And for 4.2.x, I suppose we'll simply stick with our existing code, expecting it to work with Jackson 2.7.1+? Juergen |
Sébastien Deleuze commented Indeed, for 4.2.x, Jackson 2.7.1+ will avoid the blocking error we see with 2.7.0, but it is important to notice that This commit has been merged in master. |
Juergen Hoeller opened SPR-13728 and commented
Jackson 2.7 (currently in RC1) has breaking changes in its
TypeFactory
/TypeBindings
API which break ourAbstractJackson2HttpMessageConverter
's generic type adaptation. Let's sort this out for Spring Framework 4.3, while retaining compatibility with Jackson 2.6+.Affects: 4.2.3
Reference URL: https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.7#fix-generic-type-resolution-mechanism
Issue Links:
@ResponseBody
method return type available to message convertersReferenced from: commits a730e55
The text was updated successfully, but these errors were encountered: