I think document about "RestTemplate Customization" is a little wrong. It seems creating a RestTemplateBuilder with and without a configurer both prevent any RestTemplateCustomizer beans from being used.
Comment From: pivotal-cla
@jiahongchao Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.
Comment From: pivotal-cla
@jiahongchao Thank you for signing the Contributor License Agreement!
Comment From: snicoll
Closing due to the lack of feedback. If I've misunderstood something we can always reopen.
Comment From: howard-repos
Please tell me if there is something I've misunderstood, since I'm not a native speaker.
According to documents,
Finally, you can also create your own RestTemplateBuilder bean. To prevent switching off the auto-configuration of a RestTemplateBuilder and prevent any RestTemplateCustomizer beans from being used, make sure to configure your custom instance with a RestTemplateBuilderConfigurer.
means
To prevent any RestTemplateCustomizer beans from being used, make sure to configure your custom instance with a RestTemplateBuilderConfigurer.
means
RestTemplateBuilder instance with a RestTemplateBuilderConfigurer will prevent any RestTemplateCustomizer beans from being used.
Also in the page,
The most extreme (and rarely used) option is to create your own RestTemplateBuilder bean without using a configurer. Doing so switches off the auto-configuration of a RestTemplateBuilder and prevents any RestTemplateCustomizer beans from being used.
means
The option is to create your own RestTemplateBuilder bean without using a configurer. Doing so prevents any RestTemplateCustomizer beans from being used.
means
RestTemplateBuilder instance without a RestTemplateBuilderConfigurer will prevents any RestTemplateCustomizer beans from being used.
So, restTemplateBuilder instance with and without a RestTemplateBuilderConfigurer will have the same result?
Comment From: wilkinsona
Finally, you can also create your own RestTemplateBuilder bean. To prevent switching off the auto-configuration of a RestTemplateBuilder and prevent any RestTemplateCustomizer beans from being used, make sure to configure your custom instance with a RestTemplateBuilderConfigurer.
Your understanding of this section is incorrect. It means the following:
If you declare your own
RestTemplateBuilder
bean and you do not want anyRestTemplateCustomizer
beans to be ignored, make sure to configure your custom instance with aRestTemplateBuilderConfigurer
.
I agree that we could improve the documentation to make this more clear.
The most extreme (and rarely used) option is to create your own RestTemplateBuilder bean without using a configurer. Doing so switches off the auto-configuration of a RestTemplateBuilder and prevents any RestTemplateCustomizer beans from being used.
Your understanding of this section is correct.
Comment From: howard-repos
Finally, you can also create your own RestTemplateBuilder bean. To prevent switching off the auto-configuration of a RestTemplateBuilder and prevent any RestTemplateCustomizer beans from being used, make sure to configure your custom instance with a RestTemplateBuilderConfigurer.
Your understanding of this section is incorrect. It means the following:
If you declare your own
RestTemplateBuilder
bean and you do not want anyRestTemplateCustomizer
beans to be ignored, make sure to configure your custom instance with aRestTemplateBuilderConfigurer
.I agree that we could improve the documentation to make this more clear.
The most extreme (and rarely used) option is to create your own RestTemplateBuilder bean without using a configurer. Doing so switches off the auto-configuration of a RestTemplateBuilder and prevents any RestTemplateCustomizer beans from being used.
Your understanding of this section is correct.
interesting, I thought "prevent any RestTemplateCustomizer beans from being used" means "let RestTemplateCustomizer beans to be ignored"
Comment From: wilkinsona
The wording isn't very clear at the moment so I'm not surprised that you interpreted it differently. Would you like to update your PR to make a different clarification to the documentation? If so we can re-open it and then merge it once you've had a chance to update things. If not, we can open an issue and take care of it.
Comment From: howard-repos
What is the right way to interpret " To prevent switching off the auto-configuration of a RestTemplateBuilder and prevent any RestTemplateCustomizer beans from being used, make sure to configure your custom instance with a RestTemplateBuilderConfigurer." ?
I thought it will be "To prevent switching off the auto-configuration of a RestTemplateBuilder and to prevent any RestTemplateCustomizer beans from being used, make sure to configure your custom instance with a RestTemplateBuilderConfigurer." means "configure your custom RestTemplateBuilder instance with a RestTemplateBuilderConfigurer will prevent any RestTemplateCustomizer beans from being used" means "configure your custom RestTemplateBuilder instance with a RestTemplateBuilderConfigurer will ignore RestTemplateCustomizer beans"
Comment From: wilkinsona
I tried to explain this above where I said:
If you declare your own RestTemplateBuilder bean and you do not want any RestTemplateCustomizer beans to be ignored, make sure to configure your custom instance with a RestTemplateBuilderConfigurer.
I've made a change to hopefully clarify things here. Thanks for bringing the problem to our attention.
Comment From: wilkinsona
Superseded by #29394.