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
BeanOne and BeanTwo are managed by Hibernate via JPA. If I set DefaultTyping.JAVA_LANG_OBJECT on my Object mapper, and then serialize the bean, the output will depend on if i loaded the bean from the Database.
In the case where the bean is not loaded from the database the json would look like this:
Now, in principle, everything is working as intended, because Hibernate replaces the Lists with PersistentBags which have a raw-type List inside. Jackson will thus see the raw array and add types like the friendly serializer that it is. However, when I try to deserialize that json, it fails because jackson does not expect type information for the 'links' field since that field has an explicit type.
I am not sure if this qualifies as a bug or a feature request, but I think that there should be some way to reconcile these two features.
The text was updated successfully, but these errors were encountered:
Consider a class that looks like this:
BeanOne and BeanTwo are managed by Hibernate via JPA. If I set DefaultTyping.JAVA_LANG_OBJECT on my Object mapper, and then serialize the bean, the output will depend on if i loaded the bean from the Database.
In the case where the bean is not loaded from the database the json would look like this:
In the case where the bean is loaded from the database the json would look like this:
Now, in principle, everything is working as intended, because Hibernate replaces the Lists with PersistentBags which have a raw-type List inside. Jackson will thus see the raw array and add types like the friendly serializer that it is. However, when I try to deserialize that json, it fails because jackson does not expect type information for the 'links' field since that field has an explicit type.
I am not sure if this qualifies as a bug or a feature request, but I think that there should be some way to reconcile these two features.
The text was updated successfully, but these errors were encountered: