【发布时间】:2018-07-22 18:53:13
【问题描述】:
我已将 Swagger 添加到我的 Spring Boot 2 应用程序中:
这是我的 Swagger 配置:
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket api() {
// @formatter:off
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build();
// @formatter:on
}
}
这是 Maven 依赖项:
<!-- Swagger2 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.8.0</version>
</dependency>
当我尝试调用例如 http://localhost:8080/api/actuator/auditevents 时,它会失败并出现以下错误:
TypeError: Failed to execute 'fetch' on 'Window': Request with GET/HEAD method cannot have body.
我做错了什么以及如何解决?
【问题讨论】:
-
你修好了吗?
-
有什么解决办法吗?
-
有什么消息吗?
-
这是known bug。很高兴有人发布了解决方法in the ticket comments。
标签: spring-boot swagger swagger-ui swagger-2.0