-
Bug
-
Resolution: Done
-
Major
-
3.0.1.Final
-
None
In RESTEasy 2.3.2 sub resources can be defined in separate files, but in RESTEasy 3.0.1 under certain conditions this functionality no longer works.
For example, the following code works fine in version 2.3.2:
UserResource.java
@Path("users") public interface UserResource { @GET @Path("{userID}") public UserData getUser(@PathParam("userID") String userID); }
UserCertResource.java
@Path("users/{userID}/certs") public interface UserCertResource { @GET public UserCertCollection findUserCerts( @PathParam("userID") String userID); }
UserMembershipResource.java
@Path("users/{userID}/memberships") public interface UserMembershipResource { @GET public UserMembershipCollection findUserMemberships( @PathParam("userID") String userID); }
In version 3.0.1 RESTEasy can still locate UserCertResource but not UserMembershipResource. If the UserMembershipResource is merged into UserResource it will work, but strangely UserCertResource no longer works. So the workaround is to merge all sub resources into the parent:
UserResource.java
@Path("users") public interface UserResource { @GET @Path("{userID}") public UserData getUser(@PathParam("userID") String userID); @GET @Path("{userID}/certs") public UserCertCollection findUserCerts( @PathParam("userID") String userID); @GET @Path("{userID}/memberships") public UserMembershipCollection findUserMemberships( @PathParam("userID") String userID); }