getLocalRef = (path, definitions) => {
    path = path.replace(/^#\/definitions\//, '').split('/');

    const find = (p, root) => {
      const key = p.shift();
      if (!root[key]) {
        return {};
      } if (!p.length) {
        return root[key];
      }
      return find(p, root[key]);
    };

    const result = find(path, definitions);

    if (!isObject(result)) {
      return result;
    }
    return cloneJSON(result);
  }
get object by reference. works only with local references that points on
definitions object

@param {String} path
@param {Object} definitions
@return {Object}