当前位置:网站首页>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();
}
}
边栏推荐
- Ctfshow-- common posture
- Jstat pour la commande JVM: voir les statistiques JVM
- 【SQL实战】一条SQL统计全国各地疫情分布情况
- Solve pod install error: FFI is an incompatible architecture
- 原生小程序 之 input切换 text与password类型
- mac版php装xdebug环境(m1版)
- Get the way to optimize the one-stop worktable of customer service
- Senior programmers must know and master. This article explains in detail the principle of MySQL master-slave synchronization, and recommends collecting
- Harmonyos practice - Introduction to development, analysis of atomized services
- JVM命令之 jstat:查看JVM统计信息
猜你喜欢
随机推荐
Add salt and pepper noise or Gaussian noise to the picture
测试开发基础,教你做一个完整功能的Web平台之环境准备
谈fpga和asic的区别
STM32按键状态机2——状态简化与增加长按功能
Flinksql read / write PgSQL
980. 不同路径 III DFS
Reading notes of Clickhouse principle analysis and Application Practice (6)
Go language learning notes - Gorm use - Gorm processing errors | web framework gin (10)
如何提高网站权重
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]
New Year Fireworks code plus copy, are you sure you don't want to have a look
外设驱动库开发笔记43:GPIO模拟SPI驱动
Why does the data center need a set of infrastructure visual management system
mac版php装xdebug环境(m1版)
PowerPivot——DAX(函数)
SAP Spartacus checkout 流程的扩展(extend)实现介绍
PTA TIANTI game exercise set l2-003 moon cake test point 2, test point 3 Analysis
@Detailed differences between pathvariable and @requestparam
Bat instruction processing details
If you don't know these four caching modes, dare you say you understand caching?




![R language [logic control] [mathematical operation]](/img/93/06a306561e3e7cb150d243541cc839.png)



![[FPGA tutorial case 14] design and implementation of FIR filter based on vivado core](/img/fc/5162bbb0746f8af2d6c7d63ade571a.png)
