Find WebClient / RestTemplate / ResponseEntity smells

Proprietary

HTTP-client and response-shape patterns: RestTemplate allocations (maintenance mode — use WebClient / RestClient), WebClient.create() without the builder (use WebClient.builder().baseUrl(...)), and ResponseEntity(body, HttpStatus.OK) (use the ok(body) factory).

org.openrewrite.kotlin.spring.FindWebClientRestTemplateSmells$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.spring.FindWebClientRestTemplateSmells$KtRecipe'

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

Recipe list

It runs these recipes, in this order.

  1. Find RestTemplate allocations
  2. Find WebClient.create() / WebClient.create(url) calls
  3. Find ResponseEntity(body, HttpStatus.OK) constructor calls