Is it possible to wrap the model of a response wit...
# ktor
j
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>>(...)
Ktor client, not server
n
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
Yeah, after the request is done. It is a sealed class (success, error and more)
I prefer it as feature, because I have one for retrofit too
@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?
n
never done this.. so.. no clue