Springboot 配置使用Swagger3
前言
Swagger是一个可以根据你的代码,自动生成接口文档的一个工具,并且可以用作接口测试工具,2022年了,Swagger也要用3.0版本了吧
如果你使用的是 Springboot 2.6 版本,需要配置,否则报下面的错,现在 Springboot 3.0 和 Springboot 2.5.8 不需要配置下面这
Caused by: java.lang.NullPointerException: Cannot invoke "org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.getPatterns()" because "this.condition" is null
一、引入依赖
没错,Swagger 3.0版本只需要引入这一个依赖
<!-- https://mvnrepository.com/artifac