Netflix / Hystrix

Hystrix is a latency and fault tolerance library designed to isolate points of access to remote systems, services and 3rd party libraries, stop cascading failure and enable resilience in complex distributed systems where failure is inevitable.
24.08k stars 4.7k forks source link

use a default fallback to handle all generic types return value #1979

Open linzaihui opened 4 years ago

linzaihui commented 4 years ago

Hello, I want to use a default fallback to handle all generic types return value, like this: return type: class A<T> { T data; String error; public A(Throwable ex) { data=null; error=getErrorMessage(ex); } }

api mehtods in controller will all return generic types for A A<String> api1(...) A<Map<...>> api2(...) A<Long> api3(...)

I don't want to remove the type parameter because of reduction of readability of code and swagger. Is there any configuration to skip return type validation?