当前位置:网站首页>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();
}
}
边栏推荐
- MFC BMP sets the resolution of bitmap, DPI is 600 points, and gdiplus generates labels
- CMD permanently delete specified folders and files
- 深度聚类:将深度表示学习和聚类联合优化
- Bat instruction processing details
- Web authentication API compatible version information
- Why does the data center need a set of infrastructure visual management system
- PowerPivot——DAX(函数)
- Reptile exercises (III)
- Ten stages of becoming a Senior IC Design Engineer. What stage are you in now?
- [daily training -- Tencent selected 50] 235 Nearest common ancestor of binary search tree
猜你喜欢
Industrial Finance 3.0: financial technology of "dredging blood vessels"
Forkjoin is the most comprehensive and detailed explanation (from principle design to use diagram)
Convert numbers to string strings (to_string()) convert strings to int sharp tools stoi();
Nvisual network visualization
EMMC print cqhci: timeout for tag 10 prompt analysis and solution
Deep clustering: joint optimization of depth representation learning and clustering
Chain storage of stack
Jstat pour la commande JVM: voir les statistiques JVM
SAP Spartacus checkout 流程的扩展(extend)实现介绍
【日常训练--腾讯精选50】235. 二叉搜索树的最近公共祖先
随机推荐
Loss function and positive and negative sample allocation in target detection: retinanet and focal loss
JVM命令之 jstat:查看JVM统计信息
【SQL实战】一条SQL统计全国各地疫情分布情况
Harmonyos practice - Introduction to development, analysis of atomized services
Reading notes of Clickhouse principle analysis and Application Practice (6)
MySQL performance_ Schema common performance diagnosis query
盘点国内有哪些EDA公司?
STM32 key state machine 2 - state simplification and long press function addition
一个简单的代数问题的求解
老板总问我进展,是不信任我吗?(你觉得呢)
一名普通学生的大一总结【不知我等是愚是狂,唯知一路向前奔驰】
JVM命令之 jstat:查看JVM統計信息
Determine whether the file is a DICOM file
ML's shap: Based on the adult census income binary prediction data set (whether the predicted annual income exceeds 50K), use the shap decision diagram combined with the lightgbm model to realize the
Say sqlyog deceived me!
为不同类型设备构建应用的三大更新 | 2022 I/O 重点回顾
Convert numbers to string strings (to_string()) convert strings to int sharp tools stoi();
Financial risk control practice - decision tree rule mining template
The solution of a simple algebraic problem
EMMC打印cqhci: timeout for tag 10提示分析与解决