public interface Request<P> {
It seems that when interface is defined as template class and it's methods are different templates, the compiler raises an error (JVM Issue?). Is the design of this interface is going to be that way and in the future?
Seems strange to me, using of the following definitions:
@Post
public Reply<?> sample(Request<String> request) { // what String actually means?
Person person = request.read(Person.class).as(Json.class);
return Reply.saying().ok();
}
Commit message contains information that this change is required only for FileItem for multipart forms, so to provide this client code that is using this API have to use Request<String> all over the place ?
Actually in our team we have discussed some improvements like:
@Post(accepts=Person.class, transport=Json.class)
public Reply<?> sample(Provider<Person> person) {
Person p = person.get();
}
or
@Post(accepts=Person.class, transport=Json.class)
public Reply<?> sample(Person person) {
//...
}
so when headers are not required and etc, users would be able to process objects directly. The idea of this design is that it will improve testing and etc.