We use the spring-framework restclient and with the change from spring-boot 3.4.3 to spring-boot 3.4.4 (spring-framework 6.2.3 and 6.2.5 as dependencies) we see that the jaxb unmarshaller which we set with the MarshallingHttpMessageConverter does not work the same. With that change the xml is no longer unmarshalled against the xsd but against the class, despited the fact that we have set xsd.
Our xsd has restrictions on string lengths, the generated class from the xsd does not have those restrictions. So when we unmarshal the xml agianst the xsd it fails and against the class it will succeed.
In spring-boot 3.4.3 the check was done against the xsd and from spring-boot 3.4.4 and higher the xsd is no longer checked.
Workaround could be something as described in the issue #34745. But that workaround only describes the class and not the xsd to unmarshall.
Comment From: bclozel
@strmark I had a look at #34745 and I'm not sure I'm getting the link here. Since you are reporting a regression, could you provide a minimal sample application that reproduces the problem in Spring Boot 3.4.4 but works in Spring Boot 3.4.3? This should help us narrow down the cause and work on a fix. Thanks!
Comment From: strmark
I referenced issue 34645 for the workaround mentioned in the issue, where the response is handled as a String and then manually unmarshalled to a jaxb object.
I'm still working on a minimal sample application.
Comment From: spring-projects-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: spring-projects-issues
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.
Comment From: strmark
I've created a sample marshall demo. When upgrading from SpringBoot 3.4.3 to SpringBoot 3.4.4 the default rest client get an additional xml marshal converter.
Comment From: bclozel
I see. It sounds similar to https://github.com/spring-projects/spring-framework/issues/34853
What do you think?
Comment From: strmark
Yes it is the same issue springboot 3.4.3 has the following message converters:
Springboot 3.4.4 has an additional message converter (MappingJackson2XmlHttpMessageConverter) which overrules the added MarshallingHttpMessageConverter message converter:
The workaround of removing the MappingJackson2XmlHttpMessageConverter will work.
Comment From: bclozel
Thanks for checking and sorry I didn't link this to the other issue right away. Your sample was very useful.