On 09/10/12 15:40, Santiago Pericas-Geertsen wrote:
> Sergey,
>
>> @GET
>> public Book getBook() {
>> if (something) {
>> return SuperBook();
>> } else {
>> return SuperBook2();
>> }
>> }
>
> I'm assuming you mean "sub" not "super" here.
>
Yes, though I have a sub class called 'SuperBook' in my tests, meaning
it has some super-book properties :-)
>> I reckon in writeTo() it can make sense to get the return class reported by a given method to pass directly to writeTo, so that the provider can see that the first class parameter is 'Book.class', while the instance class is object.getClass().
>
> Without discussing the technical issue any further, this is not a backward compatible change, right? What about injecting ResourceInfo in 2.0 and getting the type from there?
>
I'm afraid it is not compatible indeed.
Injecting ResourceInfo works.
Cheers, Sergey
> -- Santiago
>
>