FasterXML / jackson-dataformat-xml

Extension for Jackson JSON processor that adds support for serializing POJOs as XML (and deserializing from XML) as an alternative to JSON
Apache License 2.0
574 stars 222 forks source link

xmlMapper.readValue( xmlString , Bean.class ) for Single Boolean Value does not get the value defaults with false #641

Closed sandeepGenz closed 1 month ago

sandeepGenz commented 9 months ago

Let say there is a class Bean.java

public class Bean{
    boolean isAlive();
}

and there is a xmlString which has the above isAlive field with the value , now i need to parse this xml and store it into a java object,

but when i do xmlMapper.readValue( xmlString , Bean.class); if the isAlive() field in xmlString is true , but after deserializing through this above code , the value taken from the xml defaults to false. hence noticed that for boolean values it always defaults to false.

cowtowncoder commented 9 months ago

Unfortunately description is not enough to know what is going on: we'd need more information: specifically XML input used; and also actual Bean definition -- there seems to be no setter or field to set alive to. And finally, configuration of XmlMapper probably matters too so should be included.

cowtowncoder commented 1 month ago

Closing, need extra info to help.