mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-25 02:49:03 +00:00
Document HttpMessageConverters detection changes
This commit updates the reference documentation to better reflect changes applied in gh-48310. As of Spring Boot 4.0.1, `HttpMessageConverter` beans are all considered as "custom" converters and will be set ahead of the converters list in the auto-configuration support. For more specific changes, developers should contribute `ClientHttpMessageConvertersCustomizer` or `ServerHttpMessageConvertersCustomizer` beans to better reflect their intent: should the converter be configured for client, server or both? How should this converter be used? Previously, Spring Boot was relying on heuristics but they would cause issues for server-only converters, or for specific configuration that were not meant to replace the default converter for a given media type. Closes gh-48574
This commit is contained in:
+4
-1
@@ -98,7 +98,10 @@ Any javadoc:org.springframework.http.converter.HttpMessageConverter[] bean that
|
||||
You can also override default converters in the same way.
|
||||
|
||||
If you need to add or customize converters, you can declare one or more javadoc:org.springframework.boot.http.converter.autoconfigure.ClientHttpMessageConvertersCustomizer[] or
|
||||
javadoc:org.springframework.boot.http.converter.autoconfigure.ServerHttpMessageConvertersCustomizer[] as beans, as shown in the following listing:
|
||||
javadoc:org.springframework.boot.http.converter.autoconfigure.ServerHttpMessageConvertersCustomizer[] as beans. There, you can choose whether converter instances should be added
|
||||
before default ones (`addCustomConverter`) or if they should override a specific default converter (like `withJsonConverter`).
|
||||
|
||||
See the following listing for an example:
|
||||
|
||||
include-code::MyHttpMessageConvertersConfiguration[]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user