Skip to content

Commit 5c1d22e

Browse files
committed
Polish "Clarify that RestTemplateBuilder overwrites default converters"
Closes gh-13714
1 parent 3dbeff5 commit 5c1d22e

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

spring-boot/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ public RestTemplateBuilder rootUri(String rootUri) {
169169
/**
170170
* Set the {@link HttpMessageConverter HttpMessageConverters} that should be used with
171171
* the {@link RestTemplate}. Setting this value will replace any previously configured
172-
* converters.
172+
* converters and any converters configured on the builder will replace RestTemplate's
173+
* default converters.
173174
* @param messageConverters the converters to set
174175
* @return a new builder instance
175176
* @see #additionalMessageConverters(HttpMessageConverter...)
@@ -183,7 +184,8 @@ public RestTemplateBuilder messageConverters(
183184
/**
184185
* Set the {@link HttpMessageConverter HttpMessageConverters} that should be used with
185186
* the {@link RestTemplate}. Setting this value will replace any previously configured
186-
* converters.
187+
* converters and any converters configured on the builder will replace RestTemplate's
188+
* default converters.
187189
* @param messageConverters the converters to set
188190
* @return a new builder instance
189191
* @see #additionalMessageConverters(HttpMessageConverter...)
@@ -201,8 +203,8 @@ public RestTemplateBuilder messageConverters(
201203

202204
/**
203205
* Add additional {@link HttpMessageConverter HttpMessageConverters} that should be
204-
* used with the {@link RestTemplate}. The final list of converters replace any
205-
* RestTemplate came configured with.
206+
* used with the {@link RestTemplate}. Any converters configured on the builder will
207+
* replace RestTemplate's default converters.
206208
* @param messageConverters the converters to add
207209
* @return a new builder instance
208210
* @see #messageConverters(HttpMessageConverter...)
@@ -215,8 +217,8 @@ public RestTemplateBuilder additionalMessageConverters(
215217

216218
/**
217219
* Add additional {@link HttpMessageConverter HttpMessageConverters} that should be
218-
* used with the {@link RestTemplate}. The final list of converters replace any
219-
* RestTemplate came configured with.
220+
* used with the {@link RestTemplate}. Any converters configured on the builder will
221+
* replace RestTemplate's default converters.
220222
* @param messageConverters the converters to add
221223
* @return a new builder instance
222224
* @see #messageConverters(HttpMessageConverter...)

0 commit comments

Comments
 (0)