`public class A {
@JsonIgnore
boolean property1;
String property2;
}
ObjectMapper mapper = new ObjectMapper();
when serializedmapper.writeValueAsString(this)gives me result as {"property2" : value}and on Deserialization gives meA@ {property2:value}` but when I try to do the same thing using mix-in-annotation using a mix-in like this -:
public class MixIn { @JsonIgnore boolean property1; } mapper.addMixIn(A.class, MixIn.class);
serialization gives me result as {"property2" : value} however Deserialization -: mapper.readValue( {"property2" : value}) gives me A@ {property1 : false , property2:value } i.e. the boolean property is set to its default which I do not want. Can someone tell me what am I missing ?
I am seeing an issue while using mix-in.
`public class A {
@JsonIgnore boolean property1; String property2; }
ObjectMapper mapper = new ObjectMapper();
when serialized
mapper.writeValueAsString(this)gives me result as
{"property2" : value}and on Deserialization gives me
A@ {property2:value}` but when I try to do the same thing using mix-in-annotation using a mix-in like this -:public class MixIn { @JsonIgnore boolean property1; } mapper.addMixIn(A.class, MixIn.class);
serialization gives me result as{"property2" : value}
however Deserialization -:mapper.readValue( {"property2" : value})
gives meA@ {property1 : false , property2:value }
i.e. the boolean property is set to its default which I do not want. Can someone tell me what am I missing ?