private static void generateEnumAttributeSchema(
            JSONObject attributeSchemaTemplate, Attribute attribute, BaseConfigurator baseConfigurator) {
        Optional<String> description = getDescription(attribute, baseConfigurator);

        if (attribute.type.getEnumConstants().length == 0) {
            JSONObject jsonObject = new JSONObject().put("type", "string");
            description.ifPresent(desc -> jsonObject.put("description", desc));
            attributeSchemaTemplate.put(attribute.getName(), jsonObject);
        } else {
            ArrayList<String> attributeList = new ArrayList<>();
            for (Object obj : attribute.type.getEnumConstants()) {
                attributeList.add(obj.toString());
            }
            JSONObject jsonObject = new JSONObject().put("type", "string").put("enum", new JSONArray(attributeList));
            description.ifPresent(desc -> jsonObject.put("description", desc));
            attributeSchemaTemplate.put(attribute.getName(), jsonObject);
        }
    }
Recursive configurators tree walk (DFS) and non-describable able attributes. Collects all
configurators starting from root ones in {@link ConfigurationAsCode#getConfigurators()}

@param elements linked set (to save order) of visited elements
@param attributes siblings to find associated configurators and dive to next tree levels
@param context configuration context
@param root is this the first iteration of root attributes
plugin/src/main/java/io/jenkins/plugins/casc/SchemaGeneration.java