-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
(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 in TypeSerializerBase.writeTypeSuffix()
as well.
The idea here is to:
- Return
null
fromwriteTypePrefix()
if notypeId
passed. - In
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
for WritableId
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.