mergeAllOf = (allOfList, definitions) => {
    const { length } = allOfList;
    let index = 0;
    let result = {};

    while (index < length) {
      let item = allOfList[index];

      item = typeof item.$ref !== 'undefined' ? getLocalRef(item.$ref, definitions) : item;

      result = merge(result, item);
      index += 1;
    }

    return result;
  }
merge list of objects from allOf properties
if some of objects contains $ref field extracts this reference and merge it

@param {Array} allOfList
@param {Object} definitions
@return {Object}