Skip to content

Commit b718e58

Browse files
committed
Merge branch '3.1.x' into 3.2.x
Closes gh-40838
2 parents f440f2c + 1d91757 commit b718e58

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1952,7 +1952,8 @@
19521952
{
19531953
"name": "spring.mvc.converters.preferred-json-mapper",
19541954
"type": "java.lang.String",
1955-
"description": "Preferred JSON mapper to use for HTTP message conversion. By default, auto-detected according to the environment."
1955+
"defaultValue": "jackson",
1956+
"description": "Preferred JSON mapper to use for HTTP message conversion. By default, auto-detected according to the environment. Supported values are 'jackson', 'gson', and 'jsonb'. When other json mapping libraries (such as kotlinx.serialization) are present, use a custom HttpMessageConverters bean to control the preferred mapper."
19561957
},
19571958
{
19581959
"name": "spring.mvc.date-format",

spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/servlet.adoc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,15 @@ Sensible defaults are included out of the box.
8686
For example, objects can be automatically converted to JSON (by using the Jackson library) or XML (by using the Jackson XML extension, if available, or by using JAXB if the Jackson XML extension is not available).
8787
By default, strings are encoded in `UTF-8`.
8888

89+
Any `HttpMessageConverter` bean that is present in the context is added to the list of converters.
90+
You can also override default converters in the same way.
91+
8992
If you need to add or customize converters, you can use Spring Boot's `HttpMessageConverters` class, as shown in the following listing:
9093

9194
include::code:MyHttpMessageConvertersConfiguration[]
9295

93-
Any `HttpMessageConverter` bean that is present in the context is added to the list of converters.
94-
You can also override default converters in the same way.
96+
For further control, you can also sub-class `HttpMessageConverters` and override its `postProcessConverters` and/or `postProcessPartConverters` methods.
97+
This can be useful when you want to re-order or remove some of the converters that Spring MVC configures by default.
9598

9699

97100

0 commit comments

Comments
 (0)