小编mtr*_*ebi的帖子

用于api响应的Swagger doc(类型列表)

我正在使用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)

java swagger

9
推荐指数
1
解决办法
2万
查看次数

标签 统计

java ×1

swagger ×1