Change TypeSerializerBase
to skip generator.writeTypePrefix()
for null
typeId
#3373
Milestone
TypeSerializerBase
to skip generator.writeTypePrefix()
for null
typeId
#3373
(note: offshoot of FasterXML/jackson-core#584)
It seems that there are cases where Type Id resolution would be best handled by avoiding call altogether: specifically, when there is no Type Id passed (that is,
null
is passed).This is handled in method
TypeSerializerBase.writeTypePrefix()
; and requires some matching changes inTypeSerializerBase.writeTypeSuffix()
as well.The idea here is to:
null
fromwriteTypePrefix()
if notypeId
passed.writeTypeSuffix()
, skip processing ifWritableTypeId
passed is null (but not necessarily ifWritableTypeId.id
is null)and hopefully this will allow essentially avoiding the write, in a safe and clean manner.
The one possible complication case is that of if some existing code relied on
null
typeId being passed (null
forWritableId
would never work, would NPE). There isn't any good reliable way to catch that but... let's hope 2.14 RCs give a chance for downstream deps to check.The text was updated successfully, but these errors were encountered: