添加 Actuator 作为 groupedOpenApi
Adding Actuator as a groupedOpenApi
我们能否将 Actuator 端点添加为一个 groupedOpenApi,它将被单独吞噬?
例如:
@bean
public GroupedOpenApi actuatorApi() {
return GroupedOpenApi.builder().setGroup("Actuator")
.packagesToScan("org.springframework.boot.actuate")
.pathsToMatch("/actuator/**")
.build();
}
谢谢
首先你需要在swagger上启用actuator-ui:
springdoc.show-actuator=true
您只需要声明 GroupedOpenApi bean:
@Bean
public GroupedOpenApi actuatorApi(){
String[] paths = {"/actuator/**"};
return GroupedOpenApi.builder()
.setGroup("groups")
.pathsToMatch(paths)
.build();
}
添加执行器的步骤如下:
https://github.com/springdoc/springdoc-openapi-demos/commit/aa6bcf1f0312c8fc36f94aeb4653718b36c308f6
我们能否将 Actuator 端点添加为一个 groupedOpenApi,它将被单独吞噬?
例如:
@bean
public GroupedOpenApi actuatorApi() {
return GroupedOpenApi.builder().setGroup("Actuator")
.packagesToScan("org.springframework.boot.actuate")
.pathsToMatch("/actuator/**")
.build();
}
谢谢
首先你需要在swagger上启用actuator-ui:
springdoc.show-actuator=true
您只需要声明 GroupedOpenApi bean:
@Bean
public GroupedOpenApi actuatorApi(){
String[] paths = {"/actuator/**"};
return GroupedOpenApi.builder()
.setGroup("groups")
.pathsToMatch(paths)
.build();
}
添加执行器的步骤如下:
https://github.com/springdoc/springdoc-openapi-demos/commit/aa6bcf1f0312c8fc36f94aeb4653718b36c308f6