@Bean
    @ConditionalOnClass(name = "org.springframework.boot.actuate.autoconfigure.ManagementServerProperties")
    @ConditionalOnProperty("management.endpoints.web.base-path")
    @ConditionalOnExpression("'${management.endpoints.web.base-path}'.length() > 0")
    @ConditionalOnMissingBean(name = "swaggerSpringfoxManagementDocket")
    public Docket swaggerSpringfoxManagementDocket(@Value("${spring.application.name:application}") String appName,
        @Value("${management.endpoints.web.base-path}") String managementContextPath) {

        ApiInfo apiInfo = new ApiInfo(
            StringUtils.capitalize(appName) + " " + MANAGEMENT_TITLE_SUFFIX,
            MANAGEMENT_DESCRIPTION,
            properties.getVersion(),
            "",
            ApiInfo.DEFAULT_CONTACT,
            "",
            "",
            new ArrayList<>()
        );

        return createDocket()
            .apiInfo(apiInfo)
            .useDefaultResponseMessages(properties.isUseDefaultResponseMessages())
            .groupName(MANAGEMENT_GROUP_NAME)
            .host(properties.getHost())
            .protocols(new HashSet<>(Arrays.asList(properties.getProtocols())))
            .forCodeGeneration(true)
            .directModelSubstitute(ByteBuffer.class, String.class)
            .genericModelSubstitutes(ResponseEntity.class)
            .select()
            .paths(regex(managementContextPath + ".*"))
            .build();
    }
@ Bean @ ConditionalOnClass ( name = "org.springframework.boot.actuate.autoconfigure.ManagementServerProperties" ) @ ConditionalOnProperty ( "management.endpoints.web.base-path" ) @ ConditionalOnExpression ( "'${management.endpoints.web.base-path}'.length() > 0" ) @ ConditionalOnMissingBean ( name = "swaggerSpringfoxManagementDocket" ) public Docket swaggerSpringfoxManagementDocket ( @ Value ( "${spring.application.name:application}" ) String appName , @ Value ( "${management.endpoints.web.base-path}" ) String managementContextPath ) { ApiInfo apiInfo = new ApiInfo ( StringUtils . capitalize ( appName ) + " " + MANAGEMENT_TITLE_SUFFIX , MANAGEMENT_DESCRIPTION , properties . getVersion ( ) , "" , ApiInfo . DEFAULT_CONTACT , "" , "" , new ArrayList < > ( ) ) ; return createDocket ( ) . apiInfo ( apiInfo ) . useDefaultResponseMessages ( properties . isUseDefaultResponseMessages ( ) ) . groupName ( MANAGEMENT_GROUP_NAME ) . host ( properties . getHost ( ) ) . protocols ( new HashSet < > ( Arrays . asList ( properties . getProtocols ( ) ) ) ) . forCodeGeneration ( true ) . directModelSubstitute ( ByteBuffer . class , String . class ) . genericModelSubstitutes ( ResponseEntity . class ) . select ( ) . paths ( regex ( managementContextPath + ".*" ) ) . build ( ) ; }
Springfox configuration for the management endpoints (actuator) Swagger docs.

@param appName               the application name
@param managementContextPath the path to access management endpoints
@return the Swagger Springfox configuration