function generateComponentsWrapper(parsedOasObject, version, nodesContent = {}) {
  let components = _.isNil(parsedOasObject.components) ?
      {} :
      parsedOasObject.components,
    componentsAreReferenced = components.$ref !== undefined && !_.isEmpty(nodesContent);

  if (isSwagger(version)) {
    getBundleRulesDataByVersion(version).COMPONENTS_KEYS.forEach((property) => {
      if (parsedOasObject.hasOwnProperty(property)) {
        components[property] = parsedOasObject[property];
      }
    });
  }
  else if (parsedOasObject.hasOwnProperty('components')) {
    if (componentsAreReferenced) {
      components = _.merge(parsedOasObject.components, nodesContent[components.$ref]);
      delete components.$ref;
    }
  }

  return components;
}
Generates the components object wrapper
@param {object} parsedOasObject The parsed root
@param {string} version - The current version
@param {object} nodesContent - The nodes content
@returns {object} The components object wrapper