docs: function resolveComponentReferences(data, locals, filter = referenceProperty) {
    const referenceObjects = references.listDeepObjects(data, filter);
  
    return bluebird.all(referenceObjects).each(referenceObject => {
      return components.get(referenceObject[referenceProperty], locals)
        .then(obj => {
          // the thing we got back might have its own references
          return resolveComponentReferences(obj, locals, filter).finally(() => {
            _.assign(referenceObject, _.omit(obj, referenceProperty));
          }).catch(function (error) {
            const logObj = {
              stack: error.stack,
              cmpt: referenceObject[referenceProperty]
            };
  
            if (error.status) {
              logObj.status = error.status;
            }
  
            log('error', `${error.message}`, logObj);
  
            return bluebird.reject(error);
          });
        });
    }).then(() => data);
  }