I want to migrate from SpringFox library to SpringDoc in order to generate API docs in Open API v3 format. In my SpringFox configuration, I have disabled default response messages:
@Bean
public Docket publicApi(ServletContext servletContext) {
Docket docket = new Docket(DocumentationType.SWAGGER_2)
...
.useDefaultResponseMessages(false);
But I can't find a way to do it in SpringDoc. Migration guide says "remove Docket and use application.properties
instead". But there is no such property.
SpringFox version - 2.9.2 and SpringDoc version - 1.5.2
Is it possible to disable default response messages in SpringDoc?
Thanks
In order to disable responses described in @ControllerAdvice you should add
springdoc.override-with-generic-response=false
to .properties file
By default, it's set to "true" which automatically adds @ControllerAdvice responses to all generated responses. You can find it in docs
Thanks a lot to bnasslahsen for answering my questions on springdoc github
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With