Knife4j是一个swagger增强UI包,可以自定义请求头,对于jwt token前后端分离项目有着极大的帮助,本次记录下swagger3在Springboot中的整合,方便随时拿取
首先是swagger配置类
@Configuration
@EnableOpenApi // 启动swagger3 访问地址 http://localhost:8080/swagger-ui/index.html
@EnableKnife4j // 启动knife4j 访问地址 http://localhost:8080/doc.html
@Import(BeanValidatorPluginsConfiguration.class)
public class SwaggerConfiguration {
@Bean
public Docket DocketcreateRestApi()