首页 > 技术文章 > .net Core 使用Swagger 让某些接口不显示在文档

cxxtreasure 2021-01-26 21:18 原文

参考:https://github.com/domaindrivendev/Swashbuckle.AspNetCore#omit-arbitrary-operations
在Action 上加[ApiExplorerSettings(IgnoreApi = true)]

[HttpGet]
[ApiExplorerSettings(IgnoreApi = true)]
public ActionResult Index(string appKey , string username )
{
//todo
}

推荐阅读