这是我的 SwaggerConfig 文件。将 springfox 更新到 3.0.0
后,“com.google.common.base.Predicates”中使用的谓词已过时@EnableSwagger2
@Configuration
public class SwaggerAutoConfig {
@Value("${project.name}")
String projectName;
@Value("${project.description}")
String projectDescription;
@Value("${project.version}")
String projectVersion;
@ConditionalOnMissingBean(Docket.class)
@Bean
public Docket swaggerSetup() {
return new Docket(DocumentationType.SWAGGER_2)
.useDefaultResponseMessages(false)
.select()
.apis(RequestHandlerSelectors.any())
.paths(Predicates.not(PathSelectors.regex("/error.*")))
.build()
.apiInfo(apiInfo())
.tags(new Tag("Endpoint for faking the /islive and /isready /health
info","Endpoint for faking the /islive and /isready /health
info."));
}
显然我尝试使用 java.util.function 中的 Predicate,它似乎工作正常。还有其他方法可以解决这个问题吗?