Using javaws we can have multiple endpoints leading to the same method. Example:
@Path("/menus")
public class MenuResource {
@Path("/{menuId}/sections")
@Timed @ExceptionMetered
public MenuSectionResource getSections(@InjectParam MenuSectionResource resource) {
return resource;
}
}
@Path("/sections")
public class MenuSectionResource {
@GET
public Section get(@PathParam("menuId") String menuId, @QueryParam("id") String id) {
/// method accessed by GET in /sections or GET in /menus/{menuid}/sections
}
}
I'm trying to use swagger to document both endpoints, but i can only use one
@Api
annotation in each class, so i can generate either /sections
or /menus/{menuid}/sections
. Is it possible to automatically generate both entries in the swagger.json output?
@Path("/{menuId}/sections")
be on method inMenuSectionResource
class? Where is a real problem? Can you clarify your problem? – Equities