function removeWordFromLastPosition(schemaPath, word) {
  let splittedDataPath = schemaPath.split('/');
  if (splittedDataPath[splittedDataPath.length - 1] === word) {
    splittedDataPath.splice(-1);
  }
  return splittedDataPath.join('/');
}
Remove the defined word from the last position of a schema path
@param {string} schemaPath - a defined schemaPath
@param {string} word - word to remove
@returns {string} - the schema path with type removed