c# - 告诉 Swashbuckle 只查找具有 ApiControllerAttribute 的 Controller

标签 c# asp.net-core .net-core asp.net-core-mvc swashbuckle

我正在开发一个 Web MVC 项目,我希望在其中有一些供外部应用程序使用的 api Controller 。

我的 API Controller 上有 ApiController 属性。

不幸的是,Swashbuckle 接管了所有 Controller / Action 。
有没有办法告诉它只查找 Api Controller ?

谢谢。

最佳答案

你可以把它放在你想对 Swashbuckle 隐藏的 Controller 中

[ApiExplorerSettings(IgnoreApi = true)]
public class UserController : Controller

关于c# - 告诉 Swashbuckle 只查找具有 ApiControllerAttribute 的 Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56377359/

相关文章:

c# - 如何获取从事件处理程序中的代码隐藏动态生成的链接按钮 ID

javascript - IHttpActionResult 不会返回 JSON 对象

c# - Entity Framework 在数据库中添加了额外的字段。并添加复合键的两个成员

c# - 代理asp不加载外部xml

c# - C# 4.0 中的双重调度 - 动态关键字?

javascript - 如何在 Asp.Net Core 中不知道正确名称的情况下包含 js 文件

.net - DNX (rc1) Web 命令不起作用

c# - Asp Core 3 - 如何在 Controller 方法中允许可为空的 [FromBody] 对象

asp.net-core - 如何在 dotnet core 中验证非对称签名的 JWT?

c# - 带有 .NET CLI 的类库