簡體   English   中英

Spring Boot 2.2.4 springdoc OpenApi Swagger V3 hatoas 問題

[英]Spring Boot 2.2.4 springdoc OpenApi Swagger V3 hateoas issue

在集成springdoc-openapi-data-rest庫以將 Pageable(spring-date-commons) 對象映射到 Swagger UI 中的 URL-Parameter 后,我遇到了這個問題:

***************************
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

請問我怎樣才能有效地解決這個問題? 謝謝

要通過在 pom 文件中添加此依賴項來解決此問題:

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

受到這篇文章的啟發

希望這可以幫助某人

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM