-
Notifications
You must be signed in to change notification settings - Fork 6
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
arrow-integrations-jackson-module Either
seems Incompatible with Jackson default typing
#115
Comments
Thank you for reporting this @christophejan I wonder if we should classify this as a feature instead of a bug? Sorry for the late response I was out sick in the last couple of weeks. I wonder what's the serialization output that we would expect when this feature is enabled? In particular how should the type & generic type information serialize? My concern is if we want to support this we will need to find some way to make sure that serialization-deserialization of the class round trip. I've done some quick investigation and so far I haven't had much luck. I can't find any good way to tell jackson to preserve the runtime information of the generic types contained within We need to understand that default typing may pose some security risk so many security critical production applications have that setting disabled by default. |
We can perhaps address this in two steps - maybe firstly just ignore serializing the type information for either when default typing is activated. This way we can close this bug first so to make sure serialization works without throwing exception. Deserialization would definitely not work as we lost the generic type information in the typeId. However, maybe we can address round-tripping in a separate issue.. I'm still not convinced if we should do that though. In my humble opinion a serialization/deserialization that does not round trip sounds pretty bad. |
Hello @myuwono ! Thank you very much for your answer. You raise a lot of points... I will try to explain my point of view on some of them. First, I completely agree that the goal is to support serialization-deserialization round trip. Regarding the generated json, I'm not sure we need informations on the generic type... I don't see generic type information on generated json for a list for example... List items themself seems to take care of that through default typing... Regarding the serialization, to conform to Jackson default typing configuration, I think we have to implement Regarding deserialization, I don't know without digging further... I've considered this use-case as bug because it breaks a basic Jackson build-in feature and that's not the case with most frequently used Jackson modules. At last, default typing expose indeed to some security risks when misused (see JacksonPolymorphicDeserialization/security-risks-using-global-default-typing on wiki). That's not the case if all the content proceed by the |
Describe the bug
arrow-integrations-jackson-module for
Either
throw exception when Jackson default typing is activatedTo Reproduce
Output :
Expected behavior
arrow-integrations-jackson-module should be able de serialize/deserialize this kind of value with Jackson default typing
Environment (please complete the following information):
Additional context
Note that I know there is workaround. Currently I don't use arrow-integrations-jackson-module to manage this kind of serialization/deserialization but this imply to filter some Either properties and I think it would be great if arrow-integrations-jackson-module is able to handle Jackson default typing out of the box.
The text was updated successfully, but these errors were encountered: