Forum Discussion

vishvas's avatar
vishvas
New Member
3 years ago

Can we remove default responses status from OpenApi?

OpenApi add default responses to APIs but I want to add different responses to different APIs. I am doing it for each and every api using @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")})

But in swagger ui I'm getting 200, 201, 400, 401, 403, 404, 409, 500 all these response codes. I want to get only 200, 201, 401, 403, those which I have defined in @ApiResponses annotation.

No RepliesBe the first to reply