Find @RestController methods returning ResponseEntity<T>

Proprietary

When the only thing a controller does with ResponseEntity is ResponseEntity.ok(body), returning T directly produces the same 200 OK response with less boilerplate. Reserve ResponseEntity for endpoints that actually vary status/headers per call.

org.openrewrite.kotlin.spring.FindControllerReturningResponseEntity$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.spring.FindControllerReturningResponseEntity$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.