In android I can use something like an interceptor or an adapter in library like Retrofit, but what about ktor-client?
m
mbonnin
07/23/2019, 6:43 AM
Ktor has a JsonFeature that can parse the response for you
m
max.denissov
07/23/2019, 6:50 AM
There is no problem with json, a problem with a common data/error response. Now I am seeing Feature in ktor-client, maybe it will help me intercept server response and unwrap it.
m
mbonnin
07/23/2019, 7:22 AM
Why don't you do
@Serializable Wrapper<T>(val data: T, val error: Error)