public void EnableSwaggerUi( string routeTemplate, Action <SwaggerUiConfig> configure = null) { var config = new SwaggerUiConfig(_discoveryPaths, _rootUrlResolver); if (configure != null) { configure(config); } _httpConfig.Routes.MapHttpRoute( name: "swagger_ui", routeTemplate: routeTemplate, defaults: null, constraints: new { assetPath = @".+" }, handler: new SwaggerUiHandler(config) ); if (routeTemplate == DefaultRouteTemplate) { _httpConfig.Routes.MapHttpRoute( name: "swagger_ui_shortcut", routeTemplate: "swagger", defaults: null, constraints: null, handler: new RedirectHandler(_rootUrlResolver, "swagger/ui/index")); } }
public SwaggerUiHandler(SwaggerUiConfig config) { _config = config; }
public SwaggerUiHandler(SwaggerUiConfig config) { _config = config; }