It seems to me that this is doable, but there's a bug/bad implementation in the swagger subresource logic. It looks to be appending the @Api(value={...}) to the subresource instead of just using the @Path annotations.
But you will need to add an @Api() annotation on your subresource for this to be picked up.
// parent resource
@Path("/pet")
@Api(value = "/pet", description = "Operations about pets")
@Produces(Array(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN, MediaType.TEXT_HTML))
class PetResource extends RestResourceUtil {
@Path("/sub")
def subResource(): SubResource = {
new SubResource()
}
}
// the subresource
@Api(value = "", description = "Subresource methods") // <= this needs to be fixed
@Produces(Array("application/json"))
class SubResource extends RestResourceUtil {
@GET
@ApiOperation(value = "Get user by user name", response = classOf[User])
@ApiResponses(Array(
new ApiResponse(code = 400, message = "Invalid username supplied"),
new ApiResponse(code = 404, message = "User not found")))
def getUserByName(
@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ", required = true)@QueryParam("username") username: String) = {
// ...
}