Is it possible to wrap the model of a response with another custom model via custom feature? Is there a similar feature created to take a look to it?
Copy code
client.get<MyWrapper<SomeModel>>(...)
Javier
08/21/2020, 1:38 PM
Ktor client, not server
n
Nikky
08/21/2020, 2:36 PM
i am not sure you can return a different thing than what you are requestingin the pipeline model
is there any downside to just having a extension to wrap it after the request is done ?
what do you currently use to map the response to the type ?
j
Javier
08/21/2020, 3:08 PM
Yeah, after the request is done. It is a sealed class (success, error and more)
Javier
08/21/2020, 3:08 PM
I prefer it as feature, because I have one for retrofit too
Javier
08/22/2020, 10:48 PM
@Nikky I got the wrapper, but I am getting a ByteBufferChannel in the internal object, instead of the real object. I think it is caused because both features, Json and mine, can work together. Do you know if is there a way to depends of another feature?