@Api(value = "企业controller")
然后展示:
有描述description和tags然后修改成这样:
@Api(tags = "CompanyController", description = "企业管理controller")
最近用springboot搭建一个配置系统,使用swagger
这两行很重要:
@Configuration
@EnableSwagger2
public class Swagger2 {
@Bean
public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.basePackage("com.config"))
.paths(PathSelectors.any())
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("配置系统API")
.version("1.0")
.description("钟渊-2019-6-15")
.build();
}
}
再次启动正常:
以上为个人经验,希望能给大家一个参考,也希望大家多多支持。