java - Deserializing JSON into object with polymorphic setter methods using Jackson -


i attempting deserialize json sent rest application. object needs deserialized 3rd party object contains polymorphic methods. when attempt deserialization using jackson following exception:

conflicting setter definitions property "system": ca.uhn.fhir.model.dstu2.composite.codingdt#setsystem(1 params) vs ca.uhn.fhir.model.dstu2.composite.codingdt#setsystem(1 params)

public codingdt setsystem(uridt thevalue) {     mysystem = thevalue;     return this; }  public codingdt setsystem( string theuri) {     mysystem = new uridt(theuri);      return this;  } 

i cannot modify 3rd party class used jackson mixin described in ticket jackson mixin.this approach seems work there many classes class refers to, has same exact problem. if need add mixin each class, ending large number of mixin's making code less readable , hard maintain.

is there global setting in jackson can set, 1 of setters used, or setting provide additional info deserailizer not complain.

i have use propertynamingstrategy jackson described in http://www.javaroots.com/2013/03/how-to-use-naming-in-jackson.html. @bhdrkn

i have use following code ignore unknown properties code work.

objectmapper objectmapper = getobjectmapper(); objectmapper.configure(deserializationfeature.fail_on_unknown_properties, false); 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -