Swagger升级到3.0出现的问题
springboot使用swagger3.0时,访问http://localhost:8080/swagger-ui.html页面404,无法访问
需要导入springfox启动类依赖
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>3.0.0</version>
</dependency>
在主启动类中加上 @EnableOpenApi
@EnableOpenApi
@SpringBootApplication
public class Springboot09SwaggerApplication {
public static void main(String[] args) {
SpringApplication.run (Springboot09SwaggerApplication.class, args);
}
}
Swagger 3.0源码项目结构为