Avoiding default basic-error-controller from swagger api [duplicate]
问题 This question already has answers here : Remove Basic Error Controller In SpringFox SwaggerUI (7 answers) Closed 5 months ago . I'm using swagger2 in my spring boot project. It's working well, but I need to exclude the basic-error-controller from the api. Currently I'm using the following code using regex. It's working but is there any perfect way to do this. CODE : @Bean public Docket demoApi() { return new Docket(DocumentationType.SWAGGER_2) .select() .apis(RequestHandlerSelectors.any())