Swagger-Core似乎将@Suspended最终的AsyncResponse asyncResponse成员解释为请求主体参数.这显然不是预期的,也不是这种情况.
我想告诉swagger-core忽略这个参数并将其从api-docs中排除.有任何想法吗?
这就是我的代码:
@Stateless
@Path("/coffee")
@Api(value = "/coffee", description = "The coffee service.")
public class CoffeeService
{
@Inject
Event<CoffeeRequest> coffeeRequestListeners;
@GET
@ApiOperation(value = "Get Coffee.", notes = "Get tasty coffee.")
@ApiResponses({
@ApiResponse(code = 200, message = "OK"),
@ApiResponse(code = 404, message = "Beans not found."),
@ApiResponse(code = 500, message = "Something exceptional happend.")})
@Produces("application/json")
@Asynchronous
public void makeCoffee( @Suspended final AsyncResponse asyncResponse,
@ApiParam(value = "The coffee type.", required = true)
@QueryParam("type")
String type)
{
coffeeRequestListeners.fire(new CoffeeRequest(type, asyncResponse));
}
} …Run Code Online (Sandbox Code Playgroud)