当前位置:网站首页>Swagger3 configuration
Swagger3 configuration
2022-07-07 06:08:00 【Tunan】
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>3.0.0</version>
</dependency>
spring.application.name=shop
# ===== Customize swagger To configure ===== #
swagger.enable=true
swagger.application-name= ${spring.application.name}
swagger.application-version=1.0
#swagger.application-description=shop E-commerce platform management backend interface document
swagger.application-description=shop api info
@Component
@EnableOpenApi
@ConfigurationProperties("swagger")
@Data
public class SwaggerConfiguration{
/** * Open or not swagger, The production environment is generally closed , So here we define a variable */
private Boolean enable;
/** * Project application name */
private String applicationName;
/** * Project version information */
private String applicationVersion;
/** * Project description information */
private String applicationDescription;
@Bean
public Docket docket() {
return new Docket(DocumentationType.OAS_30)
.pathMapping("/")
// Define whether to turn on swagger,false To close , It can be controlled by variables , Online closed
.enable(enable)
// To configure api Document meta information
.apiInfo(apiInfo())
// Choose which interfaces to use as swagger Of doc Release
.select()
//apis() Control which interfaces are exposed to swagger,
// RequestHandlerSelectors.any() All exposed
// RequestHandlerSelectors.basePackage("net.xdclass.*") Specify the package location
// withMethodAnnotation(ApiOperation.class) Marked with this note ApiOperation
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
.paths(PathSelectors.any())
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title(applicationName)
.description(applicationDescription)
.contact(new Contact(" Tunan ", "111", "111"))
.version(applicationVersion)
.build();
}
}
边栏推荐
- @pathvariable 和 @Requestparam的详细区别
- 谈fpga和asic的区别
- [InstallShield] Introduction
- A freshman's summary of an ordinary student [I don't know whether we are stupid or crazy, but I know to run forward all the way]
- 外设驱动库开发笔记43:GPIO模拟SPI驱动
- 职场经历反馈给初入职场的程序员
- Detailed explanation of platform device driver architecture in driver development
- Flask1.1.4 werkzeug1.0.1 source code analysis: start the process
- 软件测试知识储备:关于「登录安全」的基础知识,你了解多少?
- Loss function and positive and negative sample allocation in target detection: retinanet and focal loss
猜你喜欢
Bypass open_ basedir
yarn入门(一篇就够了)
一个简单的代数问题的求解
EMMC print cqhci: timeout for tag 10 prompt analysis and solution
Bat instruction processing details
SAP Spartacus checkout 流程的扩展(extend)实现介绍
A freshman's summary of an ordinary student [I don't know whether we are stupid or crazy, but I know to run forward all the way]
目标检测中的BBox 回归损失函数-L2,smooth L1,IoU,GIoU,DIoU,CIoU,Focal-EIoU,Alpha-IoU,SIoU
PowerPivot——DAX(函数)
JVM命令之- jmap:导出内存映像文件&内存使用情况
随机推荐
Flask1.1.4 werkzeug1.0.1 source code analysis: start the process
Cloud acceleration helps you effectively solve attack problems!
Loss function and positive and negative sample allocation in target detection: retinanet and focal loss
[云原生]微服务架构是什么?
Storage of dental stem cells (to be continued)
Win configuration PM2 boot auto start node project
为不同类型设备构建应用的三大更新 | 2022 I/O 重点回顾
[SQL practice] a SQL statistics of epidemic distribution across the country
改变ui组件原有样式
Interview skills of software testing
深度聚类:将深度表示学习和聚类联合优化
如果不知道这4种缓存模式,敢说懂缓存吗?
[FPGA tutorial case 13] design and implementation of CIC filter based on vivado core
话说SQLyog欺骗了我!
Apple CMS V10 template /mxone Pro adaptive film and television website template
JVM命令之 jstat:查看JVM統計信息
If you don't know these four caching modes, dare you say you understand caching?
[FPGA tutorial case 14] design and implementation of FIR filter based on vivado core
[daily training -- Tencent selected 50] 235 Nearest common ancestor of binary search tree
盘点国内有哪些EDA公司?