@Configuration
@EnableSwagger2
public class Swagger2 {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
// .paths(PathSelectors.ant("/**"))
.paths(PathSelectors.any())
.build()
.apiInfo(apiInfo());
}
}
如果换成.paths(PathSelectors.ant("/**"))就不会报错,但是无法扫描到API接口