diff --git a/framework-docs/modules/ROOT/pages/integration/rest-clients.adoc b/framework-docs/modules/ROOT/pages/integration/rest-clients.adoc index d5f8ac7df3..333dae2515 100644 --- a/framework-docs/modules/ROOT/pages/integration/rest-clients.adoc +++ b/framework-docs/modules/ROOT/pages/integration/rest-clients.adoc @@ -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"]