Micronaut doesn’t honor Jackson’s @JsonGetter or @JsonSetter when the property has the same name on entities (@Entity) and projections (@Introspected).
@Introspected
public class ContactIntrospected
{
@JsonIgnore
private String phone;
@JsonGetter("phone")
public String formattedNumber() { //(1)
return Formatter.formatPhone(phone);
}
@JsonIgnore
public String getPhone() //(2)
{
return phone;
}
-
Never gets called
-
Called even though it is ignored