Version: Next

配置Swagger信息

Swagger的bean实例Docket

如何配置Docket?

在SwaggerConfig配置类中,配置Swagger2 Docket Bean实例

@Configuration
@EnableSwagger2 //开启Swagger2
public class SwaggerConfig {
//配置Swagger2 Docket Bean实例
@Bean
public Docket docket() {
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo());
}
//配置Swagger信息
@Bean
public ApiInfo apiInfo() {
//作者信息
Contact concat = new Contact("bsx", "http://ceskykrumlov.gitee.io", "11@qq.com");
List<VendorExtension> vendorExtensions = new ArrayList<>();
return new ApiInfo("Api Title",
"description: this is my document",
"1.0",
"http://ceskykrumlov.gitee.io/book",
concat,
"license",
"licenseUrl",
vendorExtensions
);
}
}