【发布时间】:2019-11-16 16:07:24
【问题描述】:
所以我从这里创建了研讨会应用程序:
(the link redirects to problematic part)
我开始在 ASP.Net Core 3.0 应用程序中配置 swashbuckle。 UI 本身可以工作,但是
我无法访问我在控制器中定义的路由并在 URL 中获取它们,因为尽管路由是在 https://localhost:5001/swagger/v1/swagger.json 中定义的,但所有内容都重定向到 https://localhost:5001/swagger/index.html
所以我无法访问例如:https://localhost:5001/api/Speakers 或任何其他路由,因为所有内容都重定向到 https://localhost:5001/swagger/index.html,并且这些路由在没有大摇大摆的情况下工作正常。
只有https://localhost:5001/swagger/v1/swagger.json 有效且索引
如何让每个 url 都可以访问?
我的swashbuckle配置和链接里的一模一样
我的数据包:Swashbuckle.AspNetCore version 5.0.0-rc4
另外,该指南适用于 net.core 2.2,我使用的是 3.0,但在招摇之前一切正常
【问题讨论】:
标签: c# asp.net swagger swashbuckle asp.net-core-3.0