Skip to content
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

Micronaut 4.3.6 breaks custom serializer for bounded generic types #865

Open
SpikeBlues opened this issue Jun 12, 2024 · 1 comment
Open
Assignees
Labels
closed: notabug The issue is not a bug type: bug Something isn't working

Comments

@SpikeBlues
Copy link

SpikeBlues commented Jun 12, 2024

Expected Behavior

For a bounded generic type (e.g. Point<T extends Serializable>), implementing a custom Serde as depicted in the micronaut-serialization documentation should allow serialization to work properly.
This has been the case with Micronaut version up to 4.3.5.

Actual Behaviour

After upgrading to 4.3.6+, we got following error with the same code base:

io.micronaut.serde.exceptions.SerdeException: No serializable introspection present for type Point.
Consider adding Serdeable. Serializable annotate to type Point. 
Alternatively if you are not in control of the project's source code, you can use @SerdeImport(Point.class) to enable serialization of this type.

However, when the generic type is unbounded (e.g. change to Point<T> instead), the test passes.

It seems the behavior has changed since #742 in terms of matching generic argument types.

Steps To Reproduce

Please refer to the reproducer repo with steps: https://github.com/SpikeBlues/micronaut-serde-issue

Environment Information

./gradlew -v

------------------------------------------------------------
Gradle 8.7
------------------------------------------------------------

Build time:   2024-03-22 15:52:46 UTC
Revision:     650af14d7653aa949fce5e886e685efc9cf97c10

Kotlin:       1.9.22
Groovy:       3.0.17
Ant:          Apache Ant(TM) version 1.10.13 compiled on January 4 2023
JVM:          21 (Eclipse Adoptium 21+35-LTS)
OS:           Mac OS X 13.6.7 aarch64

Example Application

https://github.com/SpikeBlues/micronaut-serde-issue

Version

4.3.6

@SpikeBlues SpikeBlues changed the title Micronaut 4.3.5 breaks custom serializer for bounded generic types Micronaut 4.3.6 breaks custom serializer for bounded generic types Jun 12, 2024
@graemerocher graemerocher added the type: bug Something isn't working label Jun 12, 2024
@graemerocher graemerocher moved this to Todo in 4.5.1 Release Jun 12, 2024
@graemerocher graemerocher added the closed: notabug The issue is not a bug label Jul 18, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in 4.5.1 Release Jul 18, 2024
@yawkat
Copy link
Member

yawkat commented Jul 22, 2024

Needs more eval

@yawkat yawkat reopened this Jul 22, 2024
@yawkat yawkat removed this from 4.5.1 Release Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: notabug The issue is not a bug type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants