I have to minins:
@JsonIdentityInfo(generator=ObjectIdGenerators.None.class,
property="@id")
public interface NoReferenceMixin {
}
@JsonTypeInfo(use=JsonTypeInfo.Id.CLASS,
include=JsonTypeInfo.As.PROPERTY,
property="@class")
public interface FullClassInfoMixin { }
I want to apply both of these to a particular class, Thing
. It appears that I can only add one Mixin per class, as evidenced by experiment and the existing of ObjectMapper.findMixInForClass
which returns a single Class
.
I have tried making an interface that extends both:
public interface ThingMixins extends NoReferenceMixin, FullClassInfoMixin { }
findMixInForClass
returns the mixing, but FullClassInfoMixin
is not applied. (It is harder to check if NoReferenceMixin
is applied and I have not checked that.)
What is the correct way to do this?
I am using jackson 2.9.0.pr4