function buildRecursively()

in legacy/js/docTool/schemaHelper.js [339:405]


        function buildRecursively(renderBase, schemaItem, optionPathItemName, relationInfo, enumInfo, arrayFrom) {

            if (!dtLib.isObject(schemaItem)) {
                return;
            }

            if (schemaItem.anyOf) {
                var subRenderBase = renderDocItem(
                    'isEnumParent', renderBase, schemaItem,
                    optionPathItemName, relationInfo, IS_ENUM_PARENT, arrayFrom
                );
                for (var j = 0; j < schemaItem.anyOf.length; j++) {
                    buildRecursively(
                        subRenderBase,
                        schemaItem.anyOf[j],
                        optionPathItemName,
                        null,
                        IS_ENUM_ITEM,
                        arrayFrom ? arrayFrom.slice() : null
                    );
                }
            }
            else if (schemaItem.items) {
                var subRenderBase = renderDocItem(
                    'hasArrayItems', renderBase, schemaItem,
                    optionPathItemName, relationInfo, enumInfo, arrayFrom
                );
                buildRecursively(
                    subRenderBase,
                    schemaItem.items,
                    optionPathItemName, // Actually this is array base item name.
                    IS_ARRAY_ITEM,
                    null,
                    arrayFrom
                        ? (arrayFrom.push(schemaItem), arrayFrom)
                        : [schemaItem]
                );
            }
            else if (schemaItem.properties) {
                var subRenderBase = renderDocItem(
                    'hasObjectProperties', renderBase, schemaItem,
                    optionPathItemName, relationInfo, enumInfo, arrayFrom
                );
                var properties = schemaItem.properties;

                for (var propertyName in schemaItem.properties) {
                    if (properties.hasOwnProperty(propertyName)) {
                        buildRecursively(
                            subRenderBase,
                            schemaItem.properties[propertyName],
                            propertyName,
                            IS_OBJECT_ITEM,
                            null,
                            null
                        );
                    }
                }
            }
            // SchemaItem with type of neither 'object' or 'array', and schemaItem with type of 'object'
            // but do not has properties defined.
            else {
                renderDocItem(
                    'isAtom', renderBase, schemaItem,
                    optionPathItemName, relationInfo, enumInfo, arrayFrom
                );
            }
        }