Hi
I have some issues with polymorphic collecction serialization and I'm not able to find the problem.
I have this "type" external property defined, but I'm not able to see it on my response output
Example a DarkObjectInstance serializes like
{"fields":[], "connections": "AB+/-E} and should be {"type":"dark", "fields":[], "connections": "AB+/-E}
UnknownObjectInstance will be:
{"fields":[], "primitives": [{"deck":"S"}]} and should be {"type":"unknown", "fields":[], "primitives": [{"deck":"S"}]}
@JsonTypeInfo(use =
JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXTERNAL_PROPERTY, property = "type", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = DarkObjectInstance.class, name = "dark"),
@JsonSubTypes.Type(value = UnknownObjectInstance.class, name = "unknown")})
public abstract class ObjectInstance implements Serializable {
private static final long serialVersionUID = -8515880933242237477L;
private List<String> fields;
}
public class DarkObjectInstance extends ObjectInstanceDto {
private String connections;
...
}
public class UnknownObjectInstance extends ObjectInstanceDto {
private List<Anchored> primitves;
...
}
Any help will be apreciated
BR