function validateSchemaAJV (schema, valueToUse, draftToUse) {
  let ajv,
    validate,
    filteredValidationError;

  try {
    // add Ajv options to support validation of OpenAPI schema.
    // For more details see https://ajv.js.org/#options
    ajv = buildValidatorObject(draftToUse);
    addFormats(ajv);
    validate = ajv.compile(schema);
    validate(valueToUse);
  }
  catch (e) {
    // something went wrong validating the schema
    // input was invalid. Don't throw mismatch
    return { filteredValidationError };
  }
  return { filteredValidationError, validate };
}
Used to validate schema against a value.

@param {*} schema - schema to validate
@param {*} valueToUse - value to validate schema against
@param {*} draftToUse - draft to use in this validation
@param {*} options - a standard list of options that's globally passed around. Check options.js for more.
@returns {*} - Found Validation Errors