function checkPathVariables (context, matchedPathData, transactionPathPrefix, schemaPath, components, options,
  schemaCache, jsonSchemaDialect, callback) {

  // schema path should have all parameters needed
  // components need to be stored globally
  var mismatchProperty = 'PATHVARIABLE',
    // all path variables defined in this path. acc. to the spec, all path params are required
    schemaPathVariables,
    pmPathVariables,
    determinedPathVariables = matchedPathData.pathVariables,
    unmatchedVariablesFromTransaction = matchedPathData.unmatchedVariablesFromTransaction;

  if (options.validationPropertiesToIgnore.includes(mismatchProperty)) {
    return callback(null, []);
  }

  // find all schema path variables that can be present as collection path variables
  pmPathVariables = utils.findPathVariablesFromSchemaPath(schemaPath.schemaPathName);
  schemaPathVariables = _.filter(schemaPath.parameters, (param) => {
    // exclude path variables stored as collection variable from being validated further
    return (param.in === 'path' && _.includes(pmPathVariables, param.name));
  });

  async.map(determinedPathVariables, (pathVar, cb) => {
    let mismatches = [],
      resolvedParamValue,
      index = _.findIndex(determinedPathVariables, pathVar);

    const schemaPathVar = _.find(schemaPathVariables, (param) => {
      return param.name === pathVar.key;
    });

    if (!schemaPathVar) {
      // extra pathVar present in given request.
      if (options.showMissingInSchemaErrors) {
        mismatches.push({
          property: mismatchProperty,
          // not adding the pathVar name to the jsonPath because URL is just a string
          transactionJsonPath: transactionPathPrefix + `[${index}]`,
          schemaJsonPath: null,
          reasonCode: 'MISSING_IN_SCHEMA',
          reason: `The path variable "${pathVar.key}" was not found in the schema`
        });
      }
      return cb(null, mismatches);
    }

    // don't validate variable if not present in transaction and URL path vars are not allowed
    if (!pathVar._varMatched && !options.allowUrlPathVarMatching) {
      return cb(null, mismatches);
    }

    // assign parameter example(s) as schema examples
    assignParameterExamples(schemaPathVar);

    resolvedParamValue = deserialiseParamValue(schemaPathVar, pathVar.value, PARAMETER_SOURCE.REQUEST,
      components, options, schemaCache);

    setTimeout(() => {
      if (!(schemaPathVar && schemaPathVar.schema)) {
        // no errors to show if there's no schema present in the spec
        return cb(null, []);
      }

      checkValueAgainstSchema(context,
        mismatchProperty,
        transactionPathPrefix + `[${index}].value`,
        pathVar.key,
        resolvedParamValue,
        schemaPathVar.pathPrefix + '[?(@.name==\'' + schemaPathVar.name + '\')]',
        schemaPathVar.schema,
        PARAMETER_SOURCE.REQUEST,
        components, options, schemaCache, jsonSchemaDialect, cb);
    }, 0);
  }, (err, res) => {
    let mismatches = [],
      mismatchObj;
    const unmatchedSchemaVariableNames = determinedPathVariables.filter((pathVariable) => {
      return !pathVariable._varMatched;
    }).map((schemaPathVar) => {
      return schemaPathVar.key;
    });

    if (err) {
      return callback(err);
    }

    // go through required schemaPathVariables, and params that aren't found in the given transaction are errors
    _.each(schemaPathVariables, (pathVar, index) => {
      if (!_.find(determinedPathVariables, (param) => {
        // only consider variable matching if url path variables is not allowed
        return param.key === pathVar.name && (options.allowUrlPathVarMatching || param._varMatched);
      })) {
        let reasonCode = 'MISSING_IN_REQUEST',
          reason,
          actualValue,
          currentUnmatchedVariableInTransaction = unmatchedVariablesFromTransaction[index],
          isInvalidValue = currentUnmatchedVariableInTransaction !== undefined;

        if (unmatchedSchemaVariableNames.length > 0 && isInvalidValue) {
          reason = `The ${currentUnmatchedVariableInTransaction.key} path variable does not match with ` +
            `path variable expected (${unmatchedSchemaVariableNames[index]}) in the schema at this position`;
          actualValue = {
            key: currentUnmatchedVariableInTransaction.key,
            description: getParameterDescription(currentUnmatchedVariableInTransaction),
            value: currentUnmatchedVariableInTransaction.value
          };
        }
        else {
          reason = `The required path variable "${pathVar.name}" was not found in the transaction`;
          actualValue = null;
        }

        // assign parameter example(s) as schema examples;
        assignParameterExamples(pathVar);

        mismatchObj = {
          property: mismatchProperty,
          transactionJsonPath: transactionPathPrefix,
          schemaJsonPath: pathVar.pathPrefix,
          reasonCode,
          reason
        };

        if (options.suggestAvailableFixes) {
          const resolvedSchema = resolveSchema(context, pathVar.schema, {
            resolveFor: PROCESSING_TYPE.VALIDATION
          });

          mismatchObj.suggestedFix = {
            key: pathVar.name,
            actualValue,
            suggestedValue: {
              key: pathVar.name,
              value: safeSchemaFaker(context, resolvedSchema || {}, PROCESSING_TYPE.VALIDATION,
                PARAMETER_SOURCE.REQUEST, components, SCHEMA_FORMATS.DEFAULT, schemaCache),
              description: getParameterDescription(pathVar)
            }
          };
        }
        mismatches.push(mismatchObj);
      }
    });

    // res is an array of mismatches (also an array) from all checkValueAgainstSchema calls
    return callback(null, _.concat(_.flatten(res), mismatches));
  });
}
@param {Object} context - Required context from related SchemaPack function
@param {*} matchedPathData the matchedPath data
@param {*} transactionPathPrefix the jsonpath for this validation (will be prepended to all identified mismatches)
@param {*} schemaPath the applicable pathItem defined at the schema level
@param {*} components the components + paths from the OAS spec that need to be used to resolve $refs
@param {*} options OAS options
@param {*} schemaCache object storing schemaFaker and schemaResolution caches
@param {string} jsonSchemaDialect Defined schema dialect at the OAS object
@param {*} callback Callback
@returns {array} mismatches (in the callback)