Migrate RestTemplate API calls to RestClient

Proprietary

Migrates Spring's RestTemplate to the modern RestClient API introduced in Spring Framework 6.1. RestClient provides a fluent, synchronous API that is the recommended approach for new development. This recipe converts constructor calls, type declarations, and common method invocations (getForObject, getForEntity, postForObject, postForEntity, patchForObject, put, delete, headForHeaders, postForLocation, optionsForAllow, exchange) to their RestClient equivalents. Calls that send an HttpEntity whose body is only known at runtime, or pass exchange a RequestEntity other than a variable whose body type is Void, are left as they are.

io.moderne.java.spring.boot3.MigrateToRestClientAPI
mod run . --recipe=io.moderne.java.spring.boot3.MigrateToRestClientAPI

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.