my code

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.EntityResponse;
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.ServerResponse;

import java.util.Collections;

import static org.springframework.web.reactive.function.server.RouterFunctions.route;


@Bean
RouterFunction<ServerResponse> routerFunction() {
    return route()
            .GET("test", request -> {
               // `EntityResponse` or `RenderingResponse` 
                return EntityResponse
                        .fromObject(Collections.singletonMap("Key", "Value"))
                        .build();
            })
            .build();
}

ide error tips

Bad return type in lambda expression: Mono<EntityResponse<Map<String, String>>> cannot be converted to Mono<ServerResponse>

Is this normal? Or is this API not intended for this location. I didn't mention it when I read the document

Comment From: snicoll

Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use the issue tracker only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug.