private static void collectActuatorEndpointMethodMetadata(final Method method,
                                                              final Map<Object, Object> map,
                                                              final String endpointId) throws Exception {
        var actuatorProperties = new Properties();
        try (var input = new ClassPathResource("actuators.properties").getInputStream()) {
            actuatorProperties.load(input);
        }

        var clazz = method.getDeclaringClass();

        var signature = method.toGenericString();
        signature = signature.substring(signature.lastIndexOf(method.getDeclaringClass().getSimpleName()));
        signature = RegExUtils.removePattern(signature, "throws.+");
        map.put("signature", signature);
        map.put("owner", clazz.getName());

        var returnType = method.getReturnType().getSimpleName();
        if (!StringUtils.equalsAnyIgnoreCase(returnType, "void")) {
            map.put("returnType", returnType);
        }
        map.put("casEndpoint", isCasEndpoint(clazz));

        if (clazz.getAnnotation(Deprecated.class) != null) {
            map.put("deprecated", true);
        }
        if (method.getAnnotation(Deprecated.class) != null) {
            map.put("deprecated", true);
        }

        var paramNames = ArrayUtils.EMPTY_STRING_ARRAY;
        try {
            paramNames = new StandardReflectionParameterNameDiscoverer().getParameterNames(method);
        } catch (final Throwable e) {
            LOGGER.error(e.getMessage());
        }

        for (var i = 0; i < method.getParameters().length; i++) {
            var param = method.getParameters()[i];
            var selector = param.getAnnotation(Selector.class) != null;
            selector = selector || param.getAnnotation(PathVariable.class) != null;
            if (selector) {
                map.put("selector", selector);
                var path = (String) map.get("path");

                if (path.indexOf('{') == -1) {
                    var paramName = StringUtils.EMPTY;
                    if (param.getAnnotation(PathVariable.class) != null) {
                        paramName = param.getAnnotation(PathVariable.class).name();
                    }
                    if (StringUtils.isBlank(paramName) && paramNames.length > 0) {
                        paramName = paramNames[i];
                    }

                    path = StringUtils.appendIfMissing(path, "/")
                        .concat(String.format("{%s}", paramName));
                    map.put("path", path);
                }
            }
        }

        var parameters = new ArrayList<Map<?, ?>>();
        if (isCasEndpoint(clazz)) {
            var operation = Objects.requireNonNull(method.getAnnotation(Operation.class),
                () -> "Unable to locate @Operation annotation for " + method.toGenericString()
                      + " in declaring class " + clazz.getName());
            if (!map.containsKey("deprecated") && operation.deprecated()) {
                map.put("deprecated", true);
            }
            map.put("summary", StringUtils.appendIfMissing(operation.summary(), "."));
            var paramCount = Arrays.stream(method.getParameterTypes())
                .filter(type -> !type.equals(HttpServletRequest.class) && !type.equals(HttpServletResponse.class)).count();
            
            if (operation.parameters().length == 0 && paramCount > 0) {
                for (var i = 0; i < method.getParameterTypes().length; i++) {
                    var parameter = method.getParameters()[i];

                    var pathAnn = parameter.getAnnotation(PathVariable.class);
                    if (pathAnn != null) {
                        var paramData = new LinkedHashMap<String, Object>();
                        paramData.put("name", "path-variable" + RandomUtils.randomNumeric(4));
                        paramData.put("description", "Path variable selector");
                        paramData.put("required", pathAnn.required());
                        paramData.put("defaultValue", pathAnn.value());
                        paramData.put("selector", true);
                        parameters.add(paramData);
                    }
                    var requestParamAnn = parameter.getAnnotation(RequestParam.class);
                    if (requestParamAnn != null) {
                        var paramData = new LinkedHashMap<String, Object>();
                        var name = StringUtils.defaultIfBlank(requestParamAnn.name(), requestParamAnn.value());
                        name = StringUtils.defaultIfBlank(name, parameter.getName());
                        paramData.put("name", name);
                        paramData.put("description", "Request query parameter");
                        paramData.put("required", requestParamAnn.required());
                        paramData.put("defaultValue", requestParamAnn.defaultValue());
                        paramData.put("query", true);
                        parameters.add(paramData);
                    }
                    var selectorAnn = parameter.getAnnotation(Selector.class);
                    if (selectorAnn != null) {
                        var paramData = new LinkedHashMap<String, Object>();
                        paramData.put("name", RandomUtils.randomNumeric(4));
                        paramData.put("description", "Path variable selector");
                        paramData.put("required", true);
                        paramData.put("selector", true);
                        parameters.add(paramData);
                    }
                }

                if (parameters.isEmpty()) {
                    throw new RuntimeException("Unable to locate @Parameter annotation for " + method.toGenericString()
                                               + " in declaring class " + clazz.getName());
                }
            }

            for (var i = 0; i < operation.parameters().length; i++) {
                var parameter = operation.parameters()[i];
                var paramData = new LinkedHashMap<String, Object>();
                paramData.put("name", parameter.name());
                if (StringUtils.isNotBlank(parameter.description())) {
                    paramData.put("description", parameter.description());
                } else {
                    throw new RuntimeException("No description found for parameter %s in %s".formatted(parameter.name(), clazz.getName()));
                }
                paramData.put("required", parameter.required());

                if (Objects.requireNonNull(parameter.in()) == ParameterIn.PATH) {
                    paramData.put("selector", true);
                } else {
                    paramData.put("query", true);
                }
                if (parameter.schema() != null && StringUtils.isNotBlank(parameter.schema().type())) {
                    paramData.put("type", parameter.schema().type());
                }
                parameters.add(paramData);
            }
        } else {
            var name = String.format("actuator.endpoint.%s.description", endpointId);
            var summary = actuatorProperties.getProperty(name);
            if (StringUtils.isBlank(summary)) {
                throw new RuntimeException("Unable to locate undocumented endpoint summary for: " + endpointId + " found in " + clazz.getName());
            }
            map.put("summary", StringUtils.appendIfMissing(summary, "."));
        }

        if (!parameters.isEmpty()) {
            map.put("parameters", parameters);
        }

    }
This is {@link CasDocumentationApplication}.

@author Misagh Moayyed
@since 6.4.0
docs/cas-server-documentation-processor/src/main/java/org/apereo/cas/documentation/CasDocumentationApplication.java