It is annotation used to enable Polymorphic Type handling; explained f.ex here:
https://www.baeldung.com/jackson-inheritance
>
> But related to the hierarchies to use, in Action.time there shouldn't be any hierarchies. And in Element.value the whole Dv hierarchy is allowed. That is why on Action.time I don't need the @type and yes on Element.value.
>
>>
>>
>> Second thing is that for deserialization, one can omit "type id" if
>> (but only if!) there is property `defaultImpl` for `@JsonTypeInfo`. So
>> that could be pointing to final implementation.
>
>
> That happens on Action.time, but not sure how that is linked to JsonTypeInfo or to defaultImpl, I'm lacking experience in Jackson, sorry.
>
>>
>> There is no matching setting (yet) to prevent outputting of type id
>> when polymorphic types are enabled. There is an issue to support it,
>> and maybe it gets eventually implemented.
>
>
> I guess that is needed for what I need to do here. The issue I have is 1. the model is big and complex, 2. most of the relationships are final (don't really need the @type and cutting those would cut some bytes from the final JSON), 3. only few relationships (fields) are polymorphic, but on those I could have a lot of options in terms of the inheritance hierarchy.
Saving some bytes may be nice thing to have, but in case of type id
handling tends to
1. Cause massive complexity in handling code if it tries to figure
when, how and why type id might be missing
2. Lead to unexpected, hard to diagnose failures due to complexity.
Given this, Jackson really does not try to be clever and omit (or
ignore) type information:
generally a property either HAS to have (and does use) type ids, or
does not use or have those. There is that one little exception to
support edge cases wherein even if Type Id is expected, it MAY be
omitted if (and only if) a default implementation is defined
(`defaultImpl` property of `@JsonTypeInfo`)
-+ Tatu +-