This worked with 2.2.2.GA. It is broken since 2.3.0.GA.
All of our resources are are created with Spring. We are using AOP in Spring for security and other things. In this case we have a first level resource which constructs a sub resource using Spring. Due to the AOP stuff the returned object is a proxy. Additionally the jax-rs annotations are in an interface.
We are using Jackson Json Mapper to generate the output. Jackson is configured to us tying (write a type property to output). If the returned object is generic e.g. a List<MyObject> Jackson need generic type information to do this.
With 2.2.2.GA a ParameterizedTypeImpl was passed to JacksonJsonProvider.writeTo method. With 2.3.4.Final it is a class object without generic type information.
I had a look into the sources and it looks like the cause is the same as in
org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject(HttpRequest, HttpResponse, Object):
2.2.2.GA - line 133: registry.addResourceFactory(null, null, subResourceClass);
2.3.2.Final - line 134: registry.addResourceFactory(null, null, target.getClass());//subResourceClass);
So with 2.2.2.GA the Interface was passed to ResourceMethodRegistry and this passes methods with generic type information to ResourceMethod.
With 2.3.2.Final the Proxy class itself is used. Since this doesn't contain the generic type information the wrong type is passed to Jackson.
Can you please add a fix like the one from
RESTEASY-685 for return types.