spring.mvc.throw-exception-if-no-handler-found=true spring.resources.add-mappings=false
@Configuration
@EnableSwagger2
public class SwaggerConfig extends WebMvcConfiguarationSupport {
@Override
protected void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("swagger-ui.html") .addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**") .addResourceLocations("classpath:/META-INF/resources/webjars/");
}
...
}
https://supawer0728.github.io/2019/04/04/spring-error-handling/