当前位置:网站首页>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();
}
}
边栏推荐
- 驱动开发中platform设备驱动架构详解
- zabbix_ Get test database failed
- MySQL performance_ Schema common performance diagnosis query
- Cf:c. column swapping [sort + simulate]
- 关于STC单片机“假死”状态的判别
- Get the way to optimize the one-stop worktable of customer service
- 解决pod install报错:ffi is an incompatible architecture
- Jstat pour la commande JVM: voir les statistiques JVM
- 数字IC面试总结(大厂面试经验分享)
- SubGHz, LoRaWAN, NB-IoT, 物联网
猜你喜欢
Bat instruction processing details
R language [logic control] [mathematical operation]
OpenSergo 即将发布 v1alpha1,丰富全链路异构架构的服务治理能力
Harmonyos practice - Introduction to development, analysis of atomized services
[FPGA tutorial case 13] design and implementation of CIC filter based on vivado core
JVM命令之 jinfo:实时查看和修改JVM配置参数
数据中心为什么需要一套基础设施可视化管理系统
PTA 天梯赛练习题集 L2-004 搜索树判断
Career experience feedback to novice programmers
C note 13
随机推荐
Three level menu data implementation, nested three-level menu data
404 not found service cannot be reached in SAP WebService test
MySQL performance_ Schema common performance diagnosis query
为不同类型设备构建应用的三大更新 | 2022 I/O 重点回顾
Win configuration PM2 boot auto start node project
STM32按键状态机2——状态简化与增加长按功能
成为资深IC设计工程师的十个阶段,现在的你在哪个阶段 ?
The solution of a simple algebraic problem
Ten stages of becoming a Senior IC Design Engineer. What stage are you in now?
Mysql-centos7 install MySQL through yum
From "running distractor" to data platform, Master Lu started the road of evolution
Add salt and pepper noise or Gaussian noise to the picture
Say sqlyog deceived me!
[云原生]微服务架构是什么?
一个简单的代数问题的求解
每秒10W次分词搜索,产品经理又提了一个需求!!!(收藏)
360织语发布7.0新品 为党政军、央国企打造专属“统一数字工作空间”
C. colonne Swapping [tri + Simulation]
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
PTA ladder game exercise set l2-002 linked list de duplication