SpringBoot嵌入SwaggerUI
步骤
1.jar包引入
2.基于SpringBoot配置SwaggerConfig
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket newsApi() {
//return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select().paths(PathSelectors.any()).build();
Docket docket = new Docket(DocumentationType.SWAGGER_2);
docket.enable(true);
docket.apiInfo(apiInfo()).select().paths(PathSelectors.any()).build();
return docket;
}