Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Boot Actuator / Swagger

I'm working on Spring Boot application and i use Swagger for the documentation.

I have adding Spring Boot Actuator on my application, but now i want to add the new services creating by actuator (/health /metrics ..) on my swagger documentation.

I don't find how configure Actuator and Swagger.

like image 596
Arggos Avatar asked Nov 12 '15 14:11

Arggos


1 Answers

ApiSelectorBuilder builder = new Docket(DocumentationType.SWAGGER_2)
  .useDefaultResponseMessages(false)
  .apiInfo(apiInfo())
  .securitySchemes(securitySchemes())
  .select()
  .apis(RequestHandlerSelectors.any())
  .paths(Predicates.not(PathSelectors.regex("/actuator.*")))
  .build();

Hi, You can exclude path on regex and you can chain them.

like image 121
Gweltaz Niquel Avatar answered Oct 23 '22 05:10

Gweltaz Niquel