This works fine:
@Path("/{objectId: [a-fA-F0-9]{32}}")
@ApiOperation(value = "subresource", response = SomeSubResource.class)
public SomeSubResource continueInSubResource() {
return new SomeSubResource();
}
The problem occurs when using Jersey dependency injection for creating the resources. The code is then changed to this:
@Path("/{objectId: [a-fA-F0-9]{32}}")
@ApiOperation(value = "subresource", response = SomeSubResource.class)
public Class<SomeSubResource> continueInSubResource() {
return SomeSubResource.class;
}
That is, we only tell Jersey which type of class we want, and Jersey dependency injection instantiates the correct class (passing in the dependencies to the constructor automatically). However, this seems to confuse swagger, which does not detect this subresource at all.