You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXTERNAL_PROPERTY, property = "operation")
@JsonSubTypes({
@JsonSubTypes.Type(value = Equal.class, name = "eq"),
@JsonSubTypes.Type(value = NotEqual.class, name = "noteq"),
})
public abstract class Filter {
public String operation;
}
MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES is enabled for ObjectMapper: objectMapper.enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES);
Trying to deserialize json { "operation": "EQ"} fails with: com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Could not resolve type id 'eq' into a subtype of...
but deserializing from { "operation": "eq" } works as expected.
It would be great if MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES would also work for this use case.
Tested with Jackson 2.8.0.
MantasN, megglos, Tellan, vladsolovtsov, matthias-mueller and 5 more