Spring Boot version 2.4.0 Also testins in spring boot 1.3.2.RELEASE When the default content type is set to XML if a request comes in that allows a "/" response then a Json response is returned.

Workaround: Add in a Jaxb2CollectionHttpMessageConverter and a Jaxb2RootElementHttpMessageConverter as the first convertors.

Problems with the workaround. This is undocumented behaviour checking the documentation of https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/servlet/config/annotation/WebMvcConfigurer.html#extendMessageConverters-java.util.List- It doesn't say that the order of the convertors matter.

Either this should be documented "Order of HttpConvertors matters" or there should be a different resolution stratedgy.

Therefore I'm concerned that the workaround may be less than stable.

It would be good to have an explicit favoured response type that is returned when there are equal priorities in content negotiation strategies.

A full application that uses this is posted to a related stackoverflow ticket https://stackoverflow.com/questions/65689179/how-do-you-configure-spring-boot-2-to-return-xml-by-default/65702088#65702088

I can send the file if required. Or zip up a project.

Comment From: Athas1980

duplicates #24839 Github returned 404 so thought issue was not submitted.