Spring Boot 2.2.4 springdoc OpenApi Swagger V3 讨厌问题

问题描述 投票:0回答:1

集成springdoc-openapi-data-rest库以映射Pageable(spring-date-commons)对象以更正Swagger UI中的URL参数后,我遇到了这个问题:

***************************
APPLICATION FAILED TO START
***************************

Description:

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


Process finished with exit code 0

请问我该如何有效解决这个问题?谢谢

java spring-boot spring-hateoas springdoc swagger-3.0
1个回答
3
投票

要通过在 pom 文件中添加此依赖项来解决此问题:

<dependency>
    <groupId>org.springframework.hateoas</groupId>
    <artifactId>spring-hateoas</artifactId>
    <version>1.1.1.RELEASE</version>
</dependency>

受到这篇文章的启发

希望这可以帮助别人

© www.soinside.com 2019 - 2024. All rights reserved.