function deserialiseParamValue (param, paramValue, parameterSource, components, options) {
  var constructedValue,
    paramSchema = resolveSchema(getDefaultContext(options, components), _.cloneDeep(param.schema), {
      resolveFor: PROCESSING_TYPE.VALIDATION,
      isResponseSchema: parameterSource === PARAMETER_SOURCE.RESPONSE
    }),
    isEvenNumber = (num) => {
      return (num % 2 === 0);
    },
    convertToDataType = (value) => {
      try {
        return JSON.parse(value);
      }
      catch (e) {
        return value;
      }
    };

  // for invalid param object return null
  if (!_.isObject(param) || !_.isString(paramValue)) {
    return null;
  }

  let { startValue, propSeparator, keyValueSeparator, isExplodable } =
    getParamSerialisationInfo(param, parameterSource, components, options);

  // as query params are constructed from url, during conversion we use decodeURI which converts ('%20' into ' ')
  (keyValueSeparator === '%20') && (keyValueSeparator = ' ');
  (propSeparator === '%20') && (propSeparator = ' ');

  // remove start value from serialised value
  paramValue = paramValue.slice(paramValue.indexOf(startValue) === 0 ? startValue.length : 0);

  // define value to constructed according to type
  paramSchema.type === 'object' && (constructedValue = {});
  paramSchema.type === 'array' && (constructedValue = []);

  if (constructedValue) {
    let allProps = paramValue.split(propSeparator);
    _.forEach(allProps, (element, index) => {
      let keyValArray;

      if (propSeparator === keyValueSeparator && isExplodable) {
        if (isEvenNumber(index)) {
          keyValArray = _.slice(allProps, index, index + 2);
        }
        else {
          return;
        }
      }
      else if (isExplodable) {
        keyValArray = element.split(keyValueSeparator);
      }

      if (paramSchema.type === 'object') {
        _.set(constructedValue, keyValArray[0], convertToDataType(keyValArray[1]));
      }
      else if (paramSchema.type === 'array') {
        constructedValue.push(convertToDataType(_.get(keyValArray, '[1]', element)));
      }
    });
  }
  else {
    constructedValue = paramValue;
  }
  return constructedValue;
}
This function deserialises parameter value based on param schema

@param {*} param - OpenAPI Parameter object
@param {String} paramValue - Parameter value to be deserialised
@param {String} parameterSource - Specifies whether the schema being faked is from a request or response.
@param {Object} components - OpenAPI components defined in the OAS spec. These are used to
 resolve references while generating params.
@param {object} options - a standard list of options that's globally passed around. Check options.js for more.
@param {Object} schemaCache - object storing schemaFaker and schemaResolution caches
@returns {*} - deserialises parameter value