当前位置:网站首页>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();
}
}
边栏推荐
- Mysql-centos7 install MySQL through yum
- CTFshow--常用姿势
- C. colonne Swapping [tri + Simulation]
- PTA ladder game exercise set l2-002 linked list de duplication
- Flask1.1.4 Werkzeug1.0.1 源碼分析:啟動流程
- VScode进行代码补全
- [云原生]微服务架构是什么?
- @pathvariable 和 @Requestparam的详细区别
- What EDA companies are there in China?
- Harmonyos practice - Introduction to development, analysis of atomized services
猜你喜欢

Determine whether the file is a DICOM file

@pathvariable 和 @Requestparam的详细区别
![[InstallShield] Introduction](/img/df/4522d06510ff918d00659b8358368f.jpg)
[InstallShield] Introduction

EMMC print cqhci: timeout for tag 10 prompt analysis and solution

软件测试知识储备:关于「登录安全」的基础知识,你了解多少?

JVM命令之 jinfo:实时查看和修改JVM配置参数

【SQL实战】一条SQL统计全国各地疫情分布情况
![C. colonne Swapping [tri + Simulation]](/img/0e/64d17980d3ec0051cdfb5fdb34e119.png)
C. colonne Swapping [tri + Simulation]

Jstat of JVM command: View JVM statistics

Go语学习笔记 - gorm使用 - 原生sql、命名参数、Rows、ToSQL | Web框架Gin(九)
随机推荐
PTA ladder game exercise set l2-002 linked list de duplication
Go语学习笔记 - gorm使用 - gorm处理错误 | Web框架Gin(十)
PTA 天梯赛练习题集 L2-003 月饼 测试点2,测试点3分析
驱动开发中platform设备驱动架构详解
线性回归
What EDA companies are there in China?
Flask 1.1.4 werkzeug1.0.1 analyse du code source: processus de démarrage
SubGHz, LoRaWAN, NB-IoT, 物联网
【日常训练--腾讯精选50】292. Nim 游戏
苹果cms V10模板/MXone Pro自适应影视电影网站模板
linear regression
Go语学习笔记 - gorm使用 - 原生sql、命名参数、Rows、ToSQL | Web框架Gin(九)
Cloud acceleration helps you effectively solve attack problems!
Red Hat安装内核头文件
为不同类型设备构建应用的三大更新 | 2022 I/O 重点回顾
【SQL实战】一条SQL统计全国各地疫情分布情况
On the difference between FPGA and ASIC
[FPGA tutorial case 13] design and implementation of CIC filter based on vivado core
话说SQLyog欺骗了我!
Reading notes of Clickhouse principle analysis and Application Practice (6)