I'm using Jackson with Jersey in an JAX-RS environment and refer to an external library, to which I only have limited influence. From this external library I use some dataholder/-model as return type and this has an isEmpty() method comparable to String.isEmpty()
While serialization is not a problem, the deserialization causes following exception, because the datamodel does not have an setEmpty() method and Jackson interprets the isEmpty() method as field named empty.
Unrecognized field "empty" (class de.unirostock.sems.cbarchive.meta.omex.VCard), not marked as ignorable (4 known properties: "givenName", "organization", "email", "familyName"])
at [Source: org.glassfish.jersey.message.internal.EntityInputStream@36082d97; line: 1, column: 369]
It is not an option to add @JsonIgnore to the external library, because that would cause a huge overhead, also I would prefer to not capsulate the dataholder into another one and just delegate the methods or the filter the field in JavaScript.
Is there any other possibility to force Jackson to ignore this empty "field"?