I use retrofit 2 and I have UserService with rest methods which return objects Call. I would like to invoke these methods and return just data object.
I have this:
@GET("users")
Call<List<UserDTO>> getUsers();
but I want:
@GET("users")
List<UserDTO> getUsers();
I know that was possible by default in retrofit 1.9 but i couldn't find solution for this problem. I dont want invoke method, execute call, get body and make try..catch every time when I use it.
When I invoke method from my second example I receive error:
Could not locate call adapter for java.util.List<>
Is it possible to handle this case in any adapter? And how to do it ?