FasterXML / jackson-docs

Documentation for the Jackson JSON processor.
726 stars 111 forks source link

Boolean value not ignored through mix-in annotation #15

Closed dhanabalarumugam closed 6 years ago

dhanabalarumugam commented 6 years ago

I am seeing an issue while using mix-in.

`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 ?

cowtowncoder commented 6 years ago

Wrong repo (this is for documentation), wrong forum (issue tracker is not used for asking usage questions). Instead, please use:

https://groups.google.com/forum/#!forum/jackson-user