gpt4 book ai didi

swashbuckle - 为什么 Swashbuckle 会妨碍每次通话?

转载 作者:行者123 更新时间:2023-12-05 02:59:15 25 4
gpt4 key购买 nike

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

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

我将 Swashbuckle(和 Swagger)视为文档/测试页面。所以我很担心在每次调用的路径中看到它(当我没有使用 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)

最佳答案

当您将 app.UseSwaggerUI() 添加到 Startup 类时,它会插入 swagger-ui middlewarechecks route and redirect to index URL

因此,注入(inject)到应用管道中的检查很简单

enter image description here

关于swashbuckle - 为什么 Swashbuckle 会妨碍每次通话?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58102849/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com