springboot1.4 swagger2 No matching constant for [0]

图片描述

图片描述

@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接口

阅读 5k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题