Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RestClient support customiser #2038

Open
M-Whitaker opened this issue Nov 3, 2023 · 3 comments
Open

RestClient support customiser #2038

M-Whitaker opened this issue Nov 3, 2023 · 3 comments

Comments

@M-Whitaker
Copy link

As of Spring Boot 3.2.0 RestClient has been added via Spring Framework to replace WebClient. Is there a replacement for hypermediaWebClientCustomizer?

@odrotbohm
Copy link
Member

RestClient works with a RestTemplate under the covers, so all hypermedia-related customizations would have to be (and are, in fact) applied to that, right?

@M-Whitaker
Copy link
Author

Yes this is my understanding. Currently I have a bean like this:

@Bean
  public RestClientCustomizer hypermediaRestClientCustomizer(WebConverters webConverters) {
    return builder -> builder.messageConverters(webConverters::augmentClient);

Which works fine, as you said. Is there plans to put a wrapper around this like has been done for resttemplate & web client?

@bertsanders
Copy link

bertsanders commented Dec 22, 2023

This worked for me, but only if I use RestClient.ResponseSpec.toEntity(). RestClient.ResponseSpec.body() failed to parse the response to a PagedModelType.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants