Reverse order of RestClient and RestTemplate adapters in HTTP interface section

This commit is contained in:
Arjen Poutsma 2023-07-24 09:46:05 +02:00
parent 4786e2bf53
commit 52c77d89e9
1 changed files with 12 additions and 12 deletions

View File

@ -394,7 +394,18 @@ either using `WebClient`:
RepositoryService service = factory.createClient(RepositoryService.class);
----
using `RestTemplate`:
using `RestClient`:
[source,java,indent=0,subs="verbatim,quotes"]
----
RestClient restClient = RestClient.builder().baseUrl("https://api.github.com/").build();
RestClientAdapter adapter = RestClientAdapter.create(restClient);
HttpServiceProxyFactory factory = HttpServiceProxyFactory.builderFor(adapter).build();
RepositoryService service = factory.createClient(RepositoryService.class);
----
or using `RestTemplate`:
[source,java,indent=0,subs="verbatim,quotes"]
----
@ -406,17 +417,6 @@ using `RestTemplate`:
RepositoryService service = factory.createClient(RepositoryService.class);
----
or using `RestClient`:
[source,java,indent=0,subs="verbatim,quotes"]
----
RestClient restClient = RestClient.builder().baseUrl("https://api.github.com/").build();
RestClientAdapter adapter = RestClientAdapter.create(restClient);
HttpServiceProxyFactory factory = HttpServiceProxyFactory.builderFor(adapter).build();
RepositoryService service = factory.createClient(RepositoryService.class);
----
`@HttpExchange` is supported at the type level where it applies to all methods:
[source,java,indent=0,subs="verbatim,quotes"]