Swagger学习-springboot集成

时间:2021-09-13 19:42:33   收藏:0   阅读:55

创建springboot工程并编写一个hello项目

技术分享图片

导包

<dependency>
    <groupId>io.springfox</groupId>
    <artifactId>springfox-swagger2</artifactId>
    <version>2.9.2</version>
</dependency>
<dependency>
    <groupId>io.springfox</groupId>
    <artifactId>springfox-swagger-ui</artifactId>
    <version>2.9.2</version>
</dependency>

编写SwaggerConfig

@Configuration
@EnableSwagger2    //启动swagger
public class SwaggerConfig {
}

测试:http://localhost:8080/swagger-ui.html

技术分享图片

原文:https://www.cnblogs.com/keacua/p/15260244.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!