其他分享
首页 > 其他分享> > Swagger

Swagger

作者:互联网

1.创建spring boot项目
2.导入jar

<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>

3.编写一个Hello 工程
4.配置swagger ==>Config

@Configurationbr/>@EnableSwagger2//开启swagger2
public class SwaggerConfig {
}

5.测试运行:

http://127.0.0.1:8080/swagger-ui.html

Swagger

配置swagger

swagger 的benan实例docket;
Swagger

Swagger

项目地址

标签:springfox,EnableSwagger2,Swagger,artifact,mvnrepository,io,swagger
来源: https://blog.51cto.com/14418066/2464921