我可以通过这个配置在我的 API 中显示执行器端点:
springdoc:
show-actuator: true
我可以使用以下配置管理我的 /health 端点的 http 映射:
management:
endpoint:
health:
status:
http-mapping:
down: 500
fatal: 500
out-of-service: 500
有了这个配置,Open Api UI 说我的 /health 端点的返回码是 200 和 404。我也希望它说 500。
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.5.3</version>
</dependency>