jackson-datatypes-collections
jackson-datatypes-collections copied to clipboard
PrimitiveRefMapSerializer and RefPrimitiveMapSerializer don't extend ContainerSerializer
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
.
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).
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.