【发布时间】:2015-07-21 21:56:57
【问题描述】:
在此代码中,当此方法返回 Response.noContent.build(); 时,我可以使用 Status.class @ApiOperation 吗?
@DELETE
@Path("/property/{id}")
@ApiOperation(value = "Delete", notes = "Delete a persisted property from data source.", response = Status.class??)
public Response delete(String id){
...
...
return Response.noContent().build();
}
【问题讨论】:
-
是javax.ws.rs.core.Response.Status
-
由于您没有返回尸体,我认为使用
Status没有任何意义。现在那个端点只会返回一个204 No Content,这很好。 -
确实如此。我没有返回正文,我返回 204 No Content。
-
此方法返回 204 No Content 但我的问题是我可以用@ApiOperation 作为回报吗?
标签: java rest swagger swagger-2.0