0
votes

I'm documenting my API with Swagger and I'm applying the following annotation to all of my REST Controllers:

@Api(value = "Some value", description = "Some Description", tags = {"Tag Tag Tag"})

However, I also want to include the endpoints provided by Spring Boot Actuator (/health, /info) on Swagger (and they are being included), however I can't seem to find a way to change their default description, tags, and title, among other swagger properties.

Is there a way to do this? Thanks in advance.

1

1 Answers

-1
votes

You might need to reconsider this. Those end points are intentionally suppressed for the obvious security concerns exposing those end points creates. It is not a good idea to publish the details on them.

If you really need to do it you will need to add the specific Actuator controller class you build is implementing.

So something like this.

@Bean
public Docket api() {
    return new Docket(DocumentationType.SWAGGER_2)
            .select()
            .paths(PathSelectors.any())
            .apis(RequestHandlerSelectors.basePackage("com.your.package.controller"))
            .apis(RequestHandlerSelectors.basePackage("org.springframework.boot.actuate"))
            .build().apiInfo(apiInfo());
}