Swagger2(生成在线接口文档)

  • 在pom.xml中引入依赖

  com.spring4all
  swagger-spring-boot-starter
  1.8.0.RELEASE

  • 在应用主类中增加@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(生成在线接口文档))