一、Swagger配置

前端之家收集整理的这篇文章主要介绍了一、Swagger配置前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

一、Swagger配置

1、注解不显示

SwaggerConfig文件

  //c.IncludeXmlComments(GetXmlCommentsPath());  内下面添加

c.IncludeXmlComments(Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory,@"bin\YDShengya_WebApi.xml"));

 

分享图片

 

2、使用Swagger 让某些接口不显示在文档

 在Action 上加[ApiExplorerSettings(IgnoreApi = true)]

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

  

3、

猜你在找的XML相关文章