Retrofit converter for wrapped responses #65
Unanswered
enriquebautista
asked this question in
Q&A
Replies: 1 comment 1 reply
-
I don't think a custom converter is the right layer for that. I'd suggest using a Moshi adapter to unwrap that type instead. Check out |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, can provide some examples how to handle wrapping responses please.
I need help to parse this json response:
{
"statusCode:" 0,
"statusMessage": "OK",
"resultset": {}
}
========
This return ApiResult.Failure.UnknownFailure
cause -> java.lang.ClassCastException: GenericErrorResponse cannot be cast to ApiWrappedResponse
I found some information in Retrofit
square/retrofit#2179
https://medium.com/hackernoon/retrofit-converter-for-wrapped-responses-8919298a549c
Beta Was this translation helpful? Give feedback.
All reactions