.net Core 使用Swagger 让某些接口不显示在文档

参考: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
}

posted @ 2021-01-26 21:18  竹林听雨行  阅读(688)  评论(0编辑  收藏  举报