Spring Boot Jackson XML Deserialization Ignore Property

302 Views Asked by At

During XML deserialization I want to ignore property @XmlSchemaType without modifying annotated class.

DO We have any such ignore control through application.property in spring boot?

1

There are 1 best solutions below

0
AndrewL On

The feature you are looking for it to override the default serializer that Spring is using. You declare your own Bean for this mapper and configure the mapper to do what you want.

I am more familiar with the need to do this for JSON (with Jackson) but the technique is the same to override the (Jackson) mapper for XML. Here are two articles, albeit for JSON, but they should set you on the right track:

  1. https://www.baeldung.com/spring-boot-customize-jackson-objectmapper
  2. https://www.geeksforgeeks.org/spring-boot-customize-the-jackson-objectmapper/