function validateEndpointData(
  data,
  { prettyErrorMessage = 'invalid response data', includeKeys = false } = {},
) {
  return validate(
    {
      ErrorClass: InvalidResponse,
      prettyErrorMessage,
      includeKeys,
      traceErrorMessage: 'Response did not match schema',
      traceSuccessMessage: 'Response after validation',
      allowAndStripUnknownKeys: false,
    },
    data,
    endpointSchema,
  )
}
Strictly validate the data according to the endpoint schema.
This rejects unknown/invalid keys.
Optionally it prints those keys in the message to provide detailed feedback.

@param {object} data Object containing the data for validation
@param {object} attrs Refer to individual attributes
@param {string} [attrs.prettyErrorMessage] If provided then error message is set to this value
@param {boolean} [attrs.includeKeys] If true then includes error details in error message, defaults to false
@throws {InvalidResponse|Error} Error if Joi validation fails due to invalid or no schema
@returns {object} Value if Joi validation is success