Java版本:19.0.1Spring Boot:3.0.1
使用依赖项:
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>3.0.0</version>
</dependency>
Swagger 配置等级
@Configuration
public class SwaggerConfiguration {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build();
}
没有错误,应用程序正常启动,但访问时http://localhost:8060/swagger-ui
它是404。
如果我使用的是@EnableSwagger2
,那么它在启动应用程序时显示错误,即decencies不可用。
我遵循了swagger-2-documentation-for-spring-rest-api,似乎不需要@EnableSwagger2
注解。
1条答案
按热度按时间wd2eg0qa1#
springfox-boot-starter
版本3.0.0
似乎不支持Sping Boot 3。请考虑切换到支持Spring Boot 3的SpringDoc v2。