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
Java/Kotlin classes implementing a common interface should be deserializable. Java records should optionally be deserializable.
Actual Behaviour
We noticed some very unexpected behaviour when switching from jackson to serde-jackson, resulting in a runtime exception thrown by the serde object mapper.
We are receiving command objects from RabbitMQ that have a common interface and are discerned by a type parameter. The patterns is:
We have installed a Serde deser for micronaut.rabbitmq which is working.
Now to the fun part: when the interface has an abstract method that is implemented by the classes, everything works fine. When the interface has a default method that is overriden by the classes, deserialization fails. If the interface has no method at all, deserialization fails. If we use records instead of classes, the deserialization fails.
I have linked a small project with a unit test and without any technology overhead, that demonstrates the problem.
Steps To Reproduce
Please see the code in the linked example project (just a unit test plus variants of interface/class pattern).
Expected Behavior
Java/Kotlin classes implementing a common interface should be deserializable. Java records should optionally be deserializable.
Actual Behaviour
We noticed some very unexpected behaviour when switching from jackson to serde-jackson, resulting in a runtime exception thrown by the serde object mapper.
We are receiving command objects from RabbitMQ that have a common interface and are discerned by a type parameter. The patterns is:
to deserialize JSON objects of the form
We have installed a Serde deser for micronaut.rabbitmq which is working.
Now to the fun part: when the interface has an abstract method that is implemented by the classes, everything works fine. When the interface has a default method that is overriden by the classes, deserialization fails. If the interface has no method at all, deserialization fails. If we use records instead of classes, the deserialization fails.
I have linked a small project with a unit test and without any technology overhead, that demonstrates the problem.
Steps To Reproduce
Please see the code in the linked example project (just a unit test plus variants of interface/class pattern).
Environment Information
Example Application
https://github.com/scameronde/micronaut-serde-bugreport
Version
3.7.3
The text was updated successfully, but these errors were encountered: