java - 对于另一个使用 open api 和 swagger v3
问题描述
当我使用 swagger v3(不再是 swagger v2)并打开 api 时收到此错误
Parameter 0 of method linkDiscoverers in org.springframework.hateoas.config.HateoasConfiguration required a single bean, but 3 were found:
- relProviderPluginRegistry: defined by method 'relProviderPluginRegistry' in class path resource [org/springframework/hateoas/config/HateoasConfiguration.class]
- linkDiscovererRegistry: defined in null
- entityLinksPluginRegistry: defined by method 'entityLinksPluginRegistry' in class path resource [org/springframework/hateoas/config/WebMvcEntityLinksConfiguration.class]
Action:
Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed
我的应用程序使用了错误的 spring-plugin-core,我只是从 1.2.0.RELEASE 更改为 2.0.0.RELEASE 并解决了。请记住,如果您尝试创建LinkDiscoverers
bean,则应将其删除,它将返回有关LinkDiscoverers
bean的另一个错误
<dependency>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin-core</artifactId>
<version>2.0.0.RELEASE</version>
</dependency>
解决方案
推荐阅读
- c# - XML 或 Markdown 文档?作为新程序员从哪里开始
- java - How to increase the floating point precision of a number by using BigDecimals in java?
- vb.net - 指定的参数超出有效值范围
- sass - @include media-query 在 SASS 中是什么意思?
- signed - 1001和11111001为什么都是-7?
- javascript - 无法通过订阅更改我的文本颜色
- java - 只有 Android 的“奥利奥”版本给了我一个 java.io.FileNotFoundException
- r - 将具有相同 ID 的值分组到列中,而不在 R 中对它们进行汇总
- javascript - 在componentDidMount中设置State时触发onChange?
- django-admin - Django Admin 预填充用户的电子邮件