Closed
Description
In WebMVC type application, Spring's message converter can convert the return value to a proper message(like a JSON) when controller return type declared by interface.
But, Webflux's behavior is different.
For example, we have Car class that implements Vehicle interface.
public interface Vehicle {
}
public class Car implements Vehicle {
private String gearType;
}
And then there is a controller method like that.
@GetMapping("vehicle")
public Vehicle getVehicle() {
return new Car();
}
I can get a json response of Car class with content-type: application/json
header.
But, webflux's result is defferent.
@GetMapping("vehicle")
public Mono<Vehicle> getVehicle() {
return Mono.just(new Car());
}
It only supports a 'content-type: text/event-stream' when return type is a mono of interface.
Is it a bug?