-
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
JSON deserialization for Kotlin collections on inherited classes #24033
Comments
Thanks for the report. The |
Hi, sorry for the delay. I can still reproduce with Spring Boot 3.0.2. @jhoeller Looks like a potential type caching issue in |
Before this commit, Spring MVC was unable to resolve upper or lower bounds on Spring MVC request body parameter when generic controller inheritance was involved. This use case is common with Kotlin which uses declaration-site variance for List<T>. This commit adds a related GenericTypeResolver#resolveGenericBounds used in HttpEntityMethodProcessor and RequestResponseBodyMethodProcessor to resolve properly generic parameters. Closes spring-projectsgh-24033
I have a related draft commit, we could maybe introduce related method in |
Fixed by f075120. |
I found a problem with json deserialization on lists with inherited classes and kotlin. The problem occurs when you define an abstract rest endpoint on kotlin collections.
Here's a small example:
Here's the class to deserialize:
The error message is:
according to a bug ticket in the jackson module, the problem is maybe that spring not passing type resolution context to jackson: FasterXML/jackson-module-kotlin#267
you can find the code for this also here https://github.com/vb-dci/jackson-spring-bug
The text was updated successfully, but these errors were encountered: