Swagger2(生成在线接口文档)
2018-10-25 本文已影响0人
Puny丶微芒
- 在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