Resolution: Works as Designed
Affects Version/s: 5.0.9
Fix Version/s: None
Last commented by a User:true
When I use
and my response data is
ResponseBodyAdvice will throw ClassCastException, because we can't use "supports" to check the type. It make type declare in ResponseBodyAdvice interface useless.
Currently, there is a workaround, use Object
and check the type in beforeBodyWrite, like this
but it doesn't look like a best practice.
after study the source, I found there is a class cast before call beforeBodyWrite
Can we check body is T before call beforeBodyWrite?