Swashbuckle为什么会进入每个呼叫的路径?

问题描述 投票:1回答:1

我在项目中添加了Swashbuckle.AspNetCore NuGet,它似乎运行良好。 (我得到的Swagger页面就很好了。)

但是当我在处理另一个问题(不使用Swagger页面)时,我注意到我的调用堆栈包括Swashbuckle。

我认为Swashbuckle(和Swagger)是文档/测试页。因此,我很想在每次拨打电话的途中看到它(同样,当我不使用摇摇欲坠的页面时)。

为什么Swashbuckle在我的通话路径中?(它需要做什么?)

这是我的调用堆栈,以防它有用:

Breeze.AspNetCore.QueryFns.ExtractQueryable(ActionExecutedContext context) in C:\GitHub\breeze.server.net\AspNetCore\Breeze.AspNetCore.NetCore\QueryFns.cs
Breeze.AspNetCore.BreezeQueryFilterAttribute.OnActionExecuted(ActionExecutedContext context) in C:\GitHub\breeze.server.net\AspNetCore\Breeze.AspNetCore.NetCore\QueryFilter.cs
Microsoft.AspNetCore.Mvc.Filters.ActionFilterAttribute.OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext)
Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.Invoke(HttpContext httpContext)
Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
swashbuckle
1个回答
0
投票

[将app.UseSwaggerUI()添加到启动类时,它会插入swagger-ui middleware,即checks route and redirect to index URL

因此,这是插入到应用程序管道中的简单检查

© www.soinside.com 2019 - 2024. All rights reserved.