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

PrimitiveRefMapSerializer and RefPrimitiveMapSerializer don't extend ContainerSerializer #62

Open
leventov opened this issue Oct 28, 2019 · 2 comments

Comments

@leventov
Copy link

ContainerSerializer (a class in jackson-databind) includes some non-trivial machinery which may change in any version of Jackson. PrimitiveRefMapSerializer and RefPrimitiveMapSerializer (in primitive_collections_base) duplicate some parts of that logic (and I'm not sure that they do it right). Therefore, I think it would be nice to refactor these classes to inherit from ContainerSerializer.

@cowtowncoder
Copy link
Member

In general, I agree. The only caveat is that for actual primitive value collections, there may be challenges: in databind separate PrimitiveArrayDeserializers<T> is used as base class, which does not extend ContainerDeserializerBase.

Also: let me know if I can help verifying handling -- it is certainly true that some cases are tricky and handling has evolved over time; even as recently as 2.9 with null handling (skip / fail / replace-with-empty) and merging. And that keeping up with those changes from datatype modules is challenging; yet users naturally expect feature parity (since it is sort of what datatype module approach tries to offer).

@yawkat
Copy link
Member

yawkat commented Oct 29, 2019

I think that was my reason for not extending ContainerDeserializerBase, but from what I can tell ContainerSerializer is the base class for the primitive array serializers so at least that should be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants