0

在启动时将 springdoc 与 springboot 一起使用时出现此错误

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

Description:

Parameter 4 of method openApiResource in org.springdoc.webmvc.core.SpringDocWebMvcConfiguration required a single bean, but 2 were found:
    - webEndpointServletHandlerMapping: defined by method 'webEndpointServletHandlerMapping' in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/servlet/WebMvcEndpointManagementContextConfiguration.class]
    - controllerEndpointHandlerMapping: defined by method 'controllerEndpointHandlerMapping' in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/servlet/WebMvcEndpointManagementContextConfiguration.class]

我正在使用以下版本或springdoc

    <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-webmvc-core</artifactId>
            <version>1.4.4</version>
        </dependency>

        <dependency>
            <groupId>org.openapitools</groupId>
            <artifactId>jackson-databind-nullable</artifactId>
            <version>0.2.1</version>
        </dependency>

以及以下带有启动器执行器的弹簧启动父级

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.8.RELEASE</version> <!-- lookup parent from repository -->
    </parent>

关于如何解决这个问题的任何想法?我为 spring doc 获取了最新版本,但它并没有解决我的问题

4

0 回答 0