Get difference types of JSON response Retrofit
问题 I have REST api which respond according to current state at the same path. Let's assume /api/users response with { "status":200, "error":false, "users":["a","b"] } if user is authorised. Else if user is not authorised it respond with {"status":403,"error":true,"redirect":"url"} . When defining Interface for api calls with Retrofit it needs the exact type of response object. Ex: @GET("users") Call<List<User>> getUsers() But here API server respond with different shapes of object. How to handle