def _get_array_items_schema(array_schema, items_count=0):
        """
        Create a schema for array items using both additionalItems and items.

        This 'flattens' items and additionalItems so that we can handle additionalItems
        as if each additional item was defined in items.

        The additionalItems schema will only be used if the items schema is shorter
        than items_count. So, when additionalItems is defined, the items schema will be
        extended to be at least as long as items_count.

        :rtype: ``list``
        """
        flattened_items_schema = []
        items_schema = array_schema.get("items", [])
        if isinstance(items_schema, dict):
            # with only one schema for all items, additionalItems will be ignored.
            flattened_items_schema.extend([items_schema] * items_count)
        else:
            # items is a positional array of schemas
            flattened_items_schema.extend(items_schema)

        flattened_items_schema_count = len(flattened_items_schema)
        if flattened_items_schema_count >= items_count:
            # no additional items to account for.
            return flattened_items_schema

        additional_items = array_schema.get("additionalItems", {})
        # additionalItems can be a boolean or a dict
        if additional_items and isinstance(additional_items, dict):
            # ensure that these indexes are present in the array
            flattened_items_schema.extend(
                [additional_items] * (items_count - flattened_items_schema_count)
            )

        return flattened_items_schema

        Create a schema for array items using both additionalItems and items.

        This 'flattens' items and additionalItems so that we can handle additionalItems
        as if each additional item was defined in items.

        The additionalItems schema will only be used if the items schema is shorter
        than items_count. So, when additionalItems is defined, the items schema will be
        extended to be at least as long as items_count.

        :rtype: ``list``
        
st2common/st2common/util/config_loader.py