A bit of a retrofit + EitherNet question. I have ...
# squarelibraries
c
A bit of a retrofit + EitherNet question. I have my retrofit api call return type set as
ApiResult<Success<GetBooksResponse>, DefaultFailureType>
with the Success type defined as
data class Success<T>(val status: String, val data: List<T>)
Two questions 1. Does that look right? It "works" but curious if anything could be improved upon. I feel like theres always some kotlin generics syntax that im less privy to. 2. Now I pretty much always have to get my
response.data.first().bookTitle
(an added
data
that I have to chain). Is there any way to get rid of that if I know that all of my responses will have nested
data
?