下面列出了org.springframework.boot.autoconfigure.SpringBootApplication#springfox.documentation.service.ApiInfo 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.basePackage("org.zowe.apiml.apicatalog.controllers.api"))
.paths(
PathSelectors.any()
)
.build()
.securitySchemes(
Arrays.asList(
new BasicAuth("LoginBasicAuth"),
new ApiKey("CookieAuth", "apimlAuthenticationToken", "header")
)
)
.apiInfo(
new ApiInfo(
apiTitle,
apiDescription,
apiVersion,
null,
null,
null,
null,
Collections.emptyList()
)
);
}
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.ant("/api/v1/**"))
.build()
.apiInfo(
new ApiInfo(
apiTitle,
apiDescription,
apiVersion,
null,
null,
null,
null,
Collections.emptyList()
)
);
}
/**
* Will exposed on $HOST:$PORT/swagger-ui.html
*
* @return
*/
@Bean
public Docket apiDocumentation() {
return new Docket(SWAGGER_2)
.select()
.apis(basePackage("se.magnus.microservices.composite.product"))
.paths(PathSelectors.any())
.build()
.globalResponseMessage(POST, emptyList())
.globalResponseMessage(GET, emptyList())
.globalResponseMessage(DELETE, emptyList())
.apiInfo(new ApiInfo(
apiTitle,
apiDescription,
apiVersion,
apiTermsOfServiceUrl,
new Contact(apiContactName, apiContactUrl, apiContactEmail),
apiLicense,
apiLicenseUrl,
emptyList()
));
}
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.ant("/api/v1/**"))
.build()
.apiInfo(
new ApiInfo(
apiTitle,
apiDescription,
apiVersion,
null,
null,
null,
null,
Collections.emptyList()
)
);
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
// 文档标题
.title("springboot利用swagger构建api文档")
// 文档详细描述
.description("简单优雅的restfun风格,http://www.lhdyx.cn")
// 作者
.contact(new Contact("小东", "http://www.lhdyx.cn", "[email protected]"))
// 版本号
.version("1.0")
.build();
}
private ApiInfo apiInfo() {
String author = this.getAuthor();
String url = this.getUrl();
String email = this.getEmail();
return new ApiInfoBuilder()
.title(this.getTitle())
.description(this.getDescription())
.contact(new Contact(author, url, email))
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("User Demo")
.description("Redis Cookbook Spring Data Redis Demo")
.version("1.0")
.build();
}
private ApiInfo testApiInfo() {
return new ApiInfo("APP-ENGINE接口文档",
"文档说明",
"0.1",
"NO terms of service",
new Contact("sofn", "https://github.com/sofn", "[email protected]"),
"The Apache License, Version 2.0",
"https://www.apache.org/licenses/LICENSE-2.0.html",
Collections.emptyList()
);
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("Discord Soundboard REST Documentation")
.description("Discord Soundboard REST Documentation")
.version("1.0")
.build();
}
@Bean
public ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("亚米商城接口文档")
.description("亚米商城接口文档Swagger版")
.termsOfServiceUrl("http://www.gz-yami.com/")
.contact(new Contact("广州亚米信息科技有限公司","https://www.gz-yami.com/", ""))
.version("1.0")
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("HIS")
.description("基于restful的HIS接口")
.contact("neu")
.version("1.0")
.build();
}
/**
* api信息
* @return
*/
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title(env.getProperty("swagger.title"))
.description(env.getProperty("swagger.description"))
.version(env.getProperty("swagger.version"))
.build();
}
private ApiInfo apiInfo(SwaggerProperties swaggerProperties ) {
return new ApiInfoBuilder()
.title(swaggerProperties.getApplicationTitle())
.description("https://github.com/fangjinuo http://www.cnblogs.com/f1194361820")
.termsOfServiceUrl("https://github.com/fangjinuo")
.contact("[email protected]")
.version("2.0")
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("WithMe User Relation Service")
.description("provide api of user relation")
.termsOfServiceUrl("")
.version("1.0")
.build();
}
ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("JT-808-API")
.description("API")
.termsOfServiceUrl("")
.license("")
.licenseUrl("")
.version("1.0.0")
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("SwaggerUI演示")
.description("Demo模块")
.contact("macro")
.version("1.0")
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("WingCloud")
.description("WingCloud")
.termsOfServiceUrl("http://localhost:8080")//网关端口
.version("1.0")
.build();
}
/**
* swagger 信息
*
* @return 页面信息
*/
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("消费者API")
.description("消费者API")
.termsOfServiceUrl("")
.version("1.0.0")
.contact(new Contact("", "", "")).build();
}
/**
* Api info api info.
*
* @return the api info
*/
ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("Swagger API")
.description("dubbo分布式事务解决方案之二阶段提交测试体验")
.license("Apache 2.0")
.licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html")
.termsOfServiceUrl("")
.version(VERSION)
.contact(new Contact("xiaoyu", "", "[email protected]"))
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("基础平台 RESTful APIs")
.description("基础平台 RESTful 风格的接口文档,内容详细,极大的减少了前后端的沟通成本,同时确保代码与文档保持高度一致,极大的减少维护文档的时间。")
.termsOfServiceUrl("http://www.jeeecg.org")
.contact("JEECG")
.version("1.0.0")
.build();
}
private ApiInfo apiEndPointsInfo() {
return new ApiInfoBuilder().title("Company REST API")
.description("Staffjoy Company REST API")
.contact(new Contact("bobo", "https://github.com/jskillcloud", "[email protected]"))
.license("The MIT License")
.licenseUrl("https://opensource.org/licenses/MIT")
.version("V2")
.build();
}
ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("OpenAPI Petstore")
.description("This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\")
.license("Apache-2.0")
.licenseUrl("https://www.apache.org/licenses/LICENSE-2.0.html")
.termsOfServiceUrl("")
.version("1.0.0")
.contact(new Contact("","", ""))
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("基础平台 RESTful APIs")
.description("基础平台 RESTful 风格的接口文档,内容详细,极大的减少了前后端的沟通成本,同时确保代码与文档保持高度一致,极大的减少维护文档的时间。")
.version("1.0.0")
.termsOfServiceUrl("https://github.com/MisterChangRay")
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("seckill api文档")
.description("seckill api")
.termsOfServiceUrl("http://127.0.0.1:8080/swagger.html")
.version("1.0")
.build();
}
@SuppressWarnings("rawtypes")
private ApiInfo apiInfo() {
String title = "QUARTZ MANAGER API";
String description = "Quartz Manager - REST API";
String version = "1.0.0";
String termsOfServiceUrl = null;
Contact contact = null;
String license = "Apache License 2.0";
String licenseUrl = "https://github.com/fabioformosa/quartz-manager/blob/master/LICENSE";
List<VendorExtension> vendorExtension = Collections.emptyList();
return new ApiInfo(title, description, version, termsOfServiceUrl, contact, license, licenseUrl, vendorExtension);
}
/**
* 创建该API的基本信息(这些基本信息会展现在文档页面中)
* 访问地址:http://项目实际地址/swagger-ui.html
*
* @return
*/
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("HC小区管理系统 APIs")
.description("HC小区管理系统提供的所有能力")
.termsOfServiceUrl("https://github.com/java110/MicroCommunity")
.contact("吴学文")
.version("1.0")
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("mall前台系统")
.description("mall前台模块")
.contact("macro")
.version("1.0")
.build();
}
private ApiInfo fromResourceListingInfo(Documentation documentation) {
if (documentation == null) {
return null;
}
ResourceListing resourceListing = documentation.getResourceListing();
if (resourceListing == null) {
return null;
}
ApiInfo info = resourceListing.getInfo();
if (info == null) {
return null;
}
return info;
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("Quark BBS 接口文档")
.contact("LHR")
.version("1.0")
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title(title)
.termsOfServiceUrl(serverUrl)
.description(title)
.version(version)
.contact(new Contact("hupeng","https://www.yixiang.co","[email protected]"))
.build();
}