OpenAPI 向 API 添加默认响应,但我想向不同的 API 添加不同的响应。我正在为每个 API 使用
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "successful operation"),
@ApiResponse(responseCode = "201", description = "Contact not found", content = @Content),
@ApiResponse(responseCode = "401", description = "Contact not found", content = @Content),
@ApiResponse(responseCode = "403", ref = "Notfound")})
但是在 Swagger UI 中,我得到了200
, 201
, 400
, 401
, 403
, 404
, 409
,500
所有这些响应代码。我只想得到我在注释200
中定义201
的那些。401
403
@ApiResponses