码迷,mamicode.com
首页 > 其他好文 > 详细

Swagger

时间:2020-01-07 15:55:53      阅读:88      评论:0      收藏:0      [点我收藏+]

标签:dem   git   dock   tla   ati   htm   lock   spring   dep   

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 的benan实例docket;
技术图片

技术图片

项目地址

Swagger

标签:dem   git   dock   tla   ati   htm   lock   spring   dep   

原文地址:https://blog.51cto.com/14418066/2464921

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!