What do you think about adding optional default values to @Path and @Query annotations?
In issue #210 there was discussion about what to do with null value. Maybe if default value is present - add it in case of null?
public interface API {
@GET("/user/{id}")
void getUser(
@Path("id", 1) String userId
);
}
Additionally (I'm not sure if it is possible) it would be great to call just api.getUser() for defaults.
Default values should probably be handled the same was as you would with normal Java objects: method overloading.
public interface API {
@GET("/user/1")
void getUser();
@GET("/user/{id}")
void getUser(@Path("id") String userId);
}
Most helpful comment
Default values should probably be handled the same was as you would with normal Java objects: method overloading.