我刚刚下载了 Swagger-UI 的最后一个发行版......在发送没有 JSON 正文的 DELETE 请求时,它看起来不再有效 - 请注意,这在以前的版本中运行良好。下面是我的注释:
@ApiOperation(
httpMethod = "DELETE",
nickname = "delete",
value = "Deletes an user",
response = classOf[Void])
@ApiResponses(Array(
new ApiResponse(code = 400, message = "Invalid user id"),
new ApiResponse(code = 401, message = "Request not authorized"),
new ApiResponse(code = 403, message = "User does not have required privileges"),
new ApiResponse(code = 404, message = "User not found"),
new ApiResponse(code = 412, message = "Authentication precondition failed"),
new ApiResponse(code = 500, message = "Error processing delete user request")))
def delete(
@ApiParam(
name = "userId",
value = "The id of the user to delete",
required = true)
@PathParam("userId")
userId: String) = SecuredAction.async { implicit request =>
...
}
每当我发送 DELETE 请求时,我总是会收到以下响应(错误请求):
For request 'DELETE /auth/users/5392238c1e04001e04b384b4' [Invalid Json]
同样,我没有修改我的源代码,如果我回滚到以前版本的 Swagger-UI,它会按预期工作。我错过了什么吗?万一有解决方法使它起作用?