public async Task Invoke(DownstreamContext context)
        {
            if (context.DownstreamReRoute.ClaimsToPath.Any())
            {
                Logger.LogInformation($"{context.DownstreamReRoute.DownstreamPathTemplate.Value} has instructions to convert claims to path");
                var response = _changeDownstreamPathTemplate.ChangeDownstreamPath(context.DownstreamReRoute.ClaimsToPath, context.HttpContext.User.Claims,
                                                                                  context.DownstreamReRoute.DownstreamPathTemplate, context.TemplatePlaceholderNameAndValues);

                if (response.IsError)
                {
                    Logger.LogWarning("there was an error setting queries on context, setting pipeline error");

                    SetPipelineError(context, response.Errors);
                    return;
                }
            }

            await _next.Invoke(context);
        }
        public async Task Invoke(HttpContext httpContext)
        {
            var downstreamRoute = httpContext.Items.DownstreamRoute();

            if (downstreamRoute.ClaimsToPath.Any())
            {
                Logger.LogInformation($"{downstreamRoute.DownstreamPathTemplate.Value} has instructions to convert claims to path");

                var templatePlaceholderNameAndValues = httpContext.Items.TemplatePlaceholderNameAndValues();

                var response = _changeDownstreamPathTemplate.ChangeDownstreamPath(downstreamRoute.ClaimsToPath, httpContext.User.Claims,
                                                                                  downstreamRoute.DownstreamPathTemplate, templatePlaceholderNameAndValues);

                if (response.IsError)
                {
                    Logger.LogWarning("there was an error setting queries on context, setting pipeline error");

                    httpContext.Items.UpsertErrors(response.Errors);
                    return;
                }
            }

            await _next.Invoke(httpContext);
        }