Description
Rossen Stoyanchev opened SPR-15464 and commented
Currently Flux<?>
causes NullPointerException's in message writers where there is general assumption about the generic type always being present.
Closely related to that is the rendering of Flux<Object>
which logically should be possible to handle through Jackson for example but the Jackson2Encoder
rejects it because ObjectMapper#canSerialize
returns false for java.lang.Object
.
For Flux<?>
or Flux<Object>
we can reasonably assume that the actual values will be some sub-class of Object
so we need to explicitly allow it in the Jackson encoder. This is also consistent with the treatment of {List.class
which Jackson's ObjectMapper
approves of.
Affects: 5.0 M5
Issue Links:
- Spring MVC @ResponseBody handling of Flux<?> inconsistent when type of result is unknown [SPR-15456] #20017 Spring MVC
@ResponseBody
handling of Flux<?> inconsistent when type of result is unknown
Referenced from: commits cc102c2