使用Swagger,在编写配置类时报错Caused by: java.lang.NullPointerException: Cannot invoke "org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.getPatterns()" because "this.condition" is null

1.问题

Caused by: java.lang.NullPointerException: Cannot invoke "org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.getPatterns()" because "this.condition" is null

2.解决

参考链接:解决 Cannot invoke "org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.getPatterns()" because "this.condition" is null

在你的appplication.yml文件中加入spring.mvc.pathmatch.matching-strategy=ant_path_matcher项即可

posted @ 2023-11-19 10:55  DawnTraveler  阅读(348)  评论(0编辑  收藏  举报