第一次使用Swagger时报NullPointerException
在pom文件中引入Swagger
<dependency>
<groupId>com.spring4all</groupId>
<artifactId>swagger-spring-boot-starter</artifactId>
<version>1.7.1.RELEASE</version>
</dependency>
在启动项中加入注解
@EnableSwagger2Doc 添加注解
接口注解
@ApiOperation(value = "查询终端状态")
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = JhLog.class) })
运行出现NullPointerException
org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException
解决运行空指针问题
将pom中的SpringBoot版本降低到2.6.0以下
再次运行问题解决