The serializer documentation states only with this single sentence that discriminator groups can be use with exclusion policy, however, the exclusion strategies documentation doesn't explain how to do so. How can they be used?
@Discriminator This annotation allows serialization/deserialization of relations which are polymorphic, but where a common base class exists. The @Discriminator annotation has to be applied to the least super type:
/** * @Discriminator(field = "type", disabled = false, map = {"car": "Car", "moped": "Moped"}, groups={"foo", "bar"}) */ abstract class Vehicle { } class Car extends Vehicle { } class Moped extends Vehicle { }
Note: groups is optional and is used as exclusion policy.