You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you only configure rootUri on the RestTemplateBuilder, it's ignored by RestClient.Builder as the built RestTemplate has a UriTemplateHandler that isn't a UriBuilderFactory. If you only configure baseUrl on the RestClient.Builder it's ignored as the UriBuilderFactory from the RestTemplate is used instead. Configuring both prevents the UriBuilderFactory from the RestTemplate from being used which then allows the baseUrl on the RestClient.Builder to be honored.
The text was updated successfully, but these errors were encountered:
If you only configure rootUri on the RestTemplateBuilder, it's ignored by RestClient.Builder as the built RestTemplate has a UriTemplateHandler that isn't a UriBuilderFactory.
This can be fixed by making the RootUriTemplateHandler used by RestTemplateBuilder extend Framework's DefaultUriBuilderFactory.
If you only configure baseUrl on the RestClient.Builder it's ignored as the UriBuilderFactory from the RestTemplate is used instead.
Configuring both prevents the UriBuilderFactory from the RestTemplate from being used which then allows the baseUrl on the RestClient.Builder to be honored.
After the fix for the first scenario, the UriBuilderFactory from the RestTemplate will be used instead of the RestClient.Builder.baseUrl() value. This decision is made in Framework code, and is out of Spring Boot's control. You'll get the same behavior if you create a RestTemplate and call setUriTemplateHandler on it without using Boot's RestTemplateBuilder.
I have a test that verifies all three scenarios, but the second test case won't pass until we move to Spring Framework 6.1.4 snapshots. I'll wait until then to push the changes.
You have do this:
If you only configure
rootUri
on theRestTemplateBuilder
, it's ignored byRestClient.Builder
as the builtRestTemplate
has aUriTemplateHandler
that isn't aUriBuilderFactory
. If you only configurebaseUrl
on theRestClient.Builder
it's ignored as theUriBuilderFactory
from theRestTemplate
is used instead. Configuring both prevents theUriBuilderFactory
from theRestTemplate
from being used which then allows thebaseUrl
on theRestClient.Builder
to be honored.The text was updated successfully, but these errors were encountered: