创建好springboot 2. 6. 0 项目,配置完Swagger,启动后出现的问题:
直接上图
解决方法一:
springboot降级处理
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.6</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
解决方法二:
application.properties修改配置文件
spring.mvc.pathmatch.matching-strategy=ant_path_matcher
分析原因:
Springfox使用的路径匹配是基于AntPathMatcher的,而Spring Boot 2.6.0使用的是PathPatternMatcher。
测试成功