Spring 引导:检测到无效映射模式:/**/swagger-ui/** 如何解决

Spring Boot : Invalid mapping pattern detected: /**/swagger-ui/** How to resolve it

如何解决?

描述:

Invalid mapping pattern detected: //swagger-ui/ ^ No more pattern data allowed after {*...} or ** pattern element

操作:

Fix this pattern in your application or switch to the legacy parser implementation with 'spring.mvc.pathmatch.matching-strategy=ant_path_matcher'.

我的 pom.xml

中有 spring boot starter parent 2.6.2 和 springdoc-openapi-ui 依赖版本 1.6.3
<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.6.2</version>
        <relativePath/> <!-- lookup parent from repository -->
</parent>

<dependencies>
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-ui</artifactId>
            <version>1.6.3</version>
        </dependency>
</dependencies>

而且我可以在我的机器上看到 swagger UI http://localhost:8080/swagger-ui/index。html