Spring boot 弹簧靴与招摇2
我试图在示例Spring Boot REST API中使用Spring boot 弹簧靴与招摇2,spring-boot,swagger-2.0,Spring Boot,Swagger 2.0,我试图在示例Spring Boot REST API中使用@SwaggerDefinition。我使用的是springfox-swagger22.6.1版 我用@ApiModelProperty注释了我的产品模型,用@ApiOperation注释了端点。我能够查看终点和模型文档 但是没有生成@SwaggerDefinition 我创建了以下SwaggerConfig: @Configuration @EnableSwagger2 @SwaggerDefinition( info = @i
@SwaggerDefinition
。我使用的是springfox-swagger2
2.6.1版
我用@ApiModelProperty
注释了我的产品模型,用@ApiOperation
注释了端点。我能够查看终点和模型文档
但是没有生成@SwaggerDefinition
我创建了以下SwaggerConfig
:
@Configuration
@EnableSwagger2
@SwaggerDefinition(
info = @io.swagger.annotations.Info(
description = "Spring Boot Product Store API",
version = "V1.2.3",
title = "API of a Spring Boot product store",
termsOfService = "share and care",
contact = @io.swagger.annotations.Contact(name = "John Pack",
email = "john@productsample.com ", url =
"http://productsample.com"),
license = @io.swagger.annotations.License(name = "Apache 2.0",
url = "http://www.apache.org")
)
)
public class SwaggerConfig {
@Bean
public Docket productApi() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.basePackage("pkg.controllers"))
.paths(regex("/product.*"))
.build();
}
}
对于@SwaggerDefinition
文档,还需要做些什么?提前谢谢