Affects: spring 6.1.0-RC2 with spring boot 3.2.0-RC2 and JDK21

Description I've attached a sample Spring Boot application with a single endpoint that returns the response as a wrapped List<Label>. When I retrieve the response with WebTestClient the list (correctly) contains Label instances, but when I retrieve the response with RestClient the list contains Map instances.

In both cases, I've used the same ParameterizedTypeReference when retrieving the response

Steps to Reproduce demo.zip

The application contains 2 integration tests, one of which invokes the endpoint with a RestClient and the other uses WebTestClient. The latter test passes, but the former fails.

Comment From: sdeleuze

Likely caused by the fact contextClass should be null for client side use case (it is currently set to bodyClass).

Comment From: donalmurtagh

@sdeleuze thanks for the fix. I've confirmed that this is resolved in the latest 6.1.0-SNAPSHOT