集成测试开始失败 post Spring 使用 Swagger 最新版本 2.9.2 和 HATEOS 启动 2.2.0 升级

Integration Test Started failing post Spring boot 2.2.0 upgrade with Swagger latest version 2.9.2 & HATEOS

集成测试开始失败 post Spring 使用 Swagger 最新版本 2.9.2 和 HATEOS 启动 2.2.0 升级

java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: 
Error creating bean with name 'linkDiscoverers' 
defined in class path resource [org/springframework/hateoas/config/HateoasConfiguration.class]: 
Unsatisfied dependency expressed through method 'linkDiscoverers' parameter 0; 
nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException:
No qualifying bean of type 'org.springframework.plugin.core.PluginRegistry<org.springframework.hateoas.client.LinkDiscoverer,
org.springframework.http.MediaType>' available: expected single matching bean but 
found 3: relProviderPluginRegistry,linkDiscovererRegistry,entityLinksPluginRegistry
Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: 
No qualifying bean of type 'org.springframework.plugin.core.PluginRegistry<org.springframework.hateoas.client.LinkDiscoverer, 
org.springframework.http.MediaType>' available: expected single matching bean but found 3: 
relProviderPluginRegistry,linkDiscovererRegistry,entityLinksPluginRegistry

springfox 的问题可能需要一段时间才能解决,但最新的 swagger v3 有替代方案,具有与 springfox 类似的功能

https://github.com/springdoc/springdoc-openapi.git

仅禁用了 SpringFox 依赖项,添加了 SpringDoc,并将 SpringFox bean 替换为 SpringDoc bean。一切都按预期工作。我需要做的就是在每个 rest 服务上转换几个注释,以便 SpringDoc 正确显示所有内容。 SpringDoc 确实有效

我用过这个,对我有用

     <dependency>
        <groupId>org.springframework.plugin</groupId>
        <artifactId>spring-plugin-core</artifactId>
        <version>2.0.0.RELEASE</version>
    </dependency