You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we have springdoc.override-with-generic-response=false to disable generic responses based on ControllerAdvices.
It's also possible to use @hidden in a ControllerAdvice to hide generic responses from all controllers methods.
But, AFAIK, there's no possibility to disable generic responses on a controller endpoint method.
Something like:
@RestController
@RequestMapping("/greeting")
public class ExampleController {
@DisableGenericResponses
@ReponseStastus(OK)
@ApiResponse(responseCode="200")
@GetMapping
public String getGreeting() {
return "Hello World";
}
@ReponseStastus(OK)
@ApiResponse(responseCode="200")
@GetMapping
public String sayHi() {
return "Hi";
}
}
This would be helpful because it would allow to continue using generic responses based on ControllerAdvices and disable those responses on specific endpoints, as needed.
Thank you
The text was updated successfully, but these errors were encountered:
gnfpt
changed the title
Disabling ControllerAdvice generic responses on a per Controller endpoint method
Disabling ControllerAdvice generic responses per controller endpoint method
Mar 7, 2025
gnfpt
changed the title
Disabling ControllerAdvice generic responses per controller endpoint method
Disable ControllerAdvice generic responses per controller endpoint method
Mar 12, 2025
Currently we have
springdoc.override-with-generic-response=false
to disable generic responses based on ControllerAdvices.It's also possible to use @hidden in a ControllerAdvice to hide generic responses from all controllers methods.
But, AFAIK, there's no possibility to disable generic responses on a controller endpoint method.
Something like:
This would be helpful because it would allow to continue using generic responses based on ControllerAdvices and disable those responses on specific endpoints, as needed.
Thank you
The text was updated successfully, but these errors were encountered: