Closed franjavi closed 1 year ago
I think I'd need a full reproducible test case to see what happens. This issue actually belongs under jackson-databind
(annotations package only defines annotations, but none of functionality that uses them), but for now that's ok.
FWTW from symptoms it would seem like problem was that default typing was simply not applied. It would also seem like you could simplify your code a bit by calling
mapper.enableDefaultTypingAsProperty(DefaultTyping.OBJECT_AND_NON_CONCRETE, "__class");
instead of explicitly configuring ``TypeResolverBuilder.
I tried again, but that won't work for JsonTypeInfo.Id.NAME. I attach a small test that checks it. testJackson.zip
@franjavi I did not mean it should fix it, just that it'd be simpler way to do it. I'll see if test case sheds some light on why typing is not applied.
Using 2.8.5, if we set a global configuration for the type resolver like:
The @JsonTypeInfo annotation still required. (WORKS)
(DOES NOT WORK)
Is this behavior intended? In my opinion @JsonTypeInfo is redundant here, where can be different type configurations by mistake of the developer.