Closed
Description
We are using a Mixin to override a @JsonIgnore
field in a POJO.
This is done by declaring the field in the Mixin wih a @JsonProperty
annotation.
We noticed this behavior is no longer valid in 2.14.x
Given the following code
public class MixinSample {
public static class CustomerMixin {
@JsonProperty // Also tried @JsonIgnore(false)
public String id;
}
public static void main(String[] args) throws Exception {
Customer customer = new Customer();
customer.setId("123"); // This POJO has a JsonIgnore on the id field
customer.setName("Joe");
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.addMixIn(Customer.class, CustomerMixin.class);
System.out.println("objectMapper = " + objectMapper.writeValueAsString(customer));
}
}
With jackson-databind 2.13.x it outputs as expected (Mixin overrides the JsonIgnore id field):
{"id":"123","name":"Joe"}
With jackson-databind 2.14.x it doesn't seem to take into account the mixin :
{"name":"Joe"}