Closed ftrossbach closed 1 year ago
Addendum: it works in 3.0.x when I manually add the Deserializer to the JsonbConfig when creating the Jsonb object, but I think @JsonbTypeDeserializer should work just fine on its own. Is that a misconception?
I think that this bug fix should also be applied to map values and arrays.
Describe the bug I have a container object that contains a list of containee objects and I want to use a custom serializer/deserializer to handle the elements of that list. I annotated the containee as such:
. When I serialize and deserialize a container object, deserialization fails and the stacktrace indicates that instead of using my custom deserializer, it uses the default (which then fails because there is no public no-args constructor). This works fine in Yasson 2.0.4.
To Reproduce I've created a sample project at https://github.com/ftrossbach/yasson-bug-evaluation. There is a super simple unit test:
org.example.model.SerializationTest
If you use yasson version 3.0.1 or 3.0.2, it fails. If you change the pom to use 2.0.4, it works. I can also see in the debugger that the custom deserializer is not called in 3.0.x but it is called in 2.0.4
Expected behavior Yasson should use the custom deserializer
System information: