In order to continue the discussion began in SPR-14557 and PR https://github.com/spring-projects/spring-framework/pull/1163, here is a proposal to provide hints like @JsonView
from annotated controllers to codecs.
I have proposed this mechanism because I think:
- We need a pluggable mechanism
- I guess Request/ResponseBodyAdvice
will still be needed in Reactive world, and hints are related to request/response body
- I am not in favor using ResolvableType
source because to do so we need to pass the stream type and not just the element type to the codecs, and that create some issues by exposing specific Reactive type information (dealing with Foo
versus Fluxversus
Observable
A possible alternative is to provide a lighter pluggable mechanism specific to providing hints.
Thanks in advance for your feedbacks.
Comment From: sdeleuze
I am going to propose a new PR based on @rstoyanchev feedback.