我正在使用swagger来生成我的REST API的文档.但是,我在指定某些API调用的响应时遇到问题.
这是我的代码:
@GET
@Path("/self/activities")
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(value = "Get all activities created by this user",
notes = "Returns the list that the authenticated user (JWT) has created",
response = Activity.class,
responseContainer = "List")
@ApiResponses(value = {
@ApiResponse(code = 400, response = ErrorResponse.Error.class, responseContainer = "List", message = "There was something wrong in the request and therefore could not be processed (headers, json syntax/content)"),
@ApiResponse(code = 500, response = ErrorResponse.Error.class, responseContainer = "List", message = "Unknown Internal server error")})
public void …Run Code Online (Sandbox Code Playgroud)