appendDataContext = function (plugin, settings) {
  plugin.ext('onPostHandler', (request, h) => {
    const response = request.response;
    const routePrefix = plugin.realm.modifiers.route.prefix;

    // if the reply is a view add settings data into template system
    if (response.variety === 'view') {
      // skip if the request is not for this handler
      if (routePrefix && !request.path.startsWith(routePrefix)) {
        return h.continue;
      }

      // Added to fix bug that cannot yet be reproduced in test - REVIEW
      /* $lab:coverage:off$ */
      if (!response.source.context) {
        response.source.context = {};
      }
      /* $lab:coverage:on$ */

      const prefixedSettings = Hoek.clone(settings);

      // append tags from document request to JSON request
      prefixedSettings.jsonPath = request.query.tags
        ? Utilities.appendQueryString(settings.jsonPath, 'tags', request.query.tags)
        : settings.jsonPath;

      if (routePrefix) {
        ['jsonPath', 'swaggerUIPath'].forEach((setting) => {
          prefixedSettings[setting] = routePrefix + prefixedSettings[setting];
        });
      }

      // Need JWT plugin to work with Hapi v17+ to test this again

      const prefix = findAPIKeyPrefix(settings);
      if (prefix) {
        prefixedSettings.keyPrefix = prefix;
      }

      prefixedSettings.stringified = JSON.stringify(prefixedSettings);

      response.source.context.hapiSwagger = prefixedSettings;
    }

    return h.continue;
  });
}
appends settings data in template context

@param  {Object} plugin
@param  {Object} settings
@return {Object}