async function fetchEndpointData(
  serviceInstance,
  { url, httpErrors, validationPrettyErrorMessage, includeKeys },
) {
  const json = await serviceInstance._requestJson({
    schema: anySchema,
    url,
    httpErrors,
    logErrors: [],
    options: { decompress: true, timeout: { request: 3500 } },
  })
  return validateEndpointData(json, {
    prettyErrorMessage: validationPrettyErrorMessage,
    includeKeys,
  })
}
Fetches data from the endpoint and validates the data.

@param {object} serviceInstance Instance of Endpoint class
@param {object} attrs Refer to individual attributes
@param {string} attrs.url Endpoint URL
@param {object} attrs.httpErrors Object containing error messages for different error codes
@param {string} attrs.validationPrettyErrorMessage If provided then the error message is set to this value
@param {boolean} attrs.includeKeys If true then includes error details in error message
@returns {object} Data fetched from endpoint