public static IApplicationBuilder UseEventBusDoc(
            this IApplicationBuilder builder,
            Action <EventBusDocOptions> setUpAction = null)
        {
            if (setUpAction == null)
            {
                builder.UseMiddleware <EventBusDocGeneratorMiddleware>();
            }
            else
            {
                var options = new EventBusDocOptions();
                setUpAction.Invoke(options);
                builder.UseMiddleware <EventBusDocGeneratorMiddleware>(options);
            }

            return(builder);
        }
 public EventBusDocGeneratorMiddleware(RequestDelegate next, EventBusDocOptions options)
 {
     _next          = next;
     _settings      = options.ServiceSettings;
     _requesMatcher = new TemplateMatcher(TemplateParser.Parse(options.RouteTemplate), new RouteValueDictionary());
 }