function filterCompositeSchemaErrors (schema, validationMismatches) {
  _.forEach(['anyOf', 'oneOf'], (compositeSchemaKeyword) => {
    const compositeSchemaMismatches = _.filter(validationMismatches, (validationMismatch) => {
      return validationMismatch.keyword === compositeSchemaKeyword &&
        _.endsWith(validationMismatch.schemaPath, compositeSchemaKeyword);
    });

    _.forEach(compositeSchemaMismatches, (compositeSchemaMismatch) => {
      let compositeSchemaMismatchPath = compositeSchemaMismatch.schemaPath,
        schemaDataPath = formatDataPath(formatSchemaPathFromAJVErrorToConvertToDataPath(compositeSchemaMismatchPath)),
        schemaToUse = schemaDataPath ? _.get(schema, schemaDataPath) : schema,
        isCompositeSchemaValid = false;

      if (!_.isArray(schemaToUse)) {
        return false;
      }

      for (let index = 0; index < schemaToUse.length; index++) {
        const isCurrentElementInvalid = _.some(validationMismatches, (mismatch) => {
          return _.startsWith(mismatch.schemaPath, compositeSchemaMismatchPath + `/${index}`);
        });

        if (!isCurrentElementInvalid) {
          isCompositeSchemaValid = true;
          break;
        }
      }

      if (isCompositeSchemaValid) {
        validationMismatches = _.reject(validationMismatches, (mismatch) => {
          return _.startsWith(mismatch.schemaPath, compositeSchemaMismatchPath);
        });
      }
    });
  });

  return validationMismatches;
}
Filter composite schema related mismatches.

@param {*} schema - schema to validate
@param {Array} validationMismatches - Array of standard AJV mismatches
@returns {Array} Filtered mismatches after removing composite schema mismatches for valid data