美文网首页
Swagger2(生成在线接口文档)

Swagger2(生成在线接口文档)

作者: Puny丶微芒 | 来源:发表于2018-10-25 13:27 被阅读0次
  • 在pom.xml中引入依赖
<dependency>
  <groupId>com.spring4all</groupId>
  <artifactId>swagger-spring-boot-starter</artifactId>
  <version>1.8.0.RELEASE</vsersion>
</dependency>
  • 在应用主类中增加@EnableSwagger2Doc注解
@SpringBootApplication
@EnableSwagger2Doc
  public class SpringSwagger2Application{
    public static void main(String[] args){
      SpirngApplication.run(Springboot2Swagger2Application.class,args)
  }
}

默认访问地址 http://localhost:8080/swagger-ui.html

自定义UI界面

相关文章

网友评论

      本文标题:Swagger2(生成在线接口文档)

      本文链接:https://www.haomeiwen.com/subject/yghftqtx.html