WebFlux should support Flux<?> and Flux<Object> rendering [SPR-15464] #20024
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
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 theJackson2Encoder
rejects it becauseObjectMapper#canSerialize
returns false forjava.lang.Object
.For
Flux<?>
orFlux<Object>
we can reasonably assume that the actual values will be some sub-class ofObject
so we need to explicitly allow it in the Jackson encoder. This is also consistent with the treatment of{List.class
which Jackson'sObjectMapper
approves of.Affects: 5.0 M5
Issue Links:
@ResponseBody
handling of Flux<?> inconsistent when type of result is unknownReferenced from: commits cc102c2
The text was updated successfully, but these errors were encountered: