开发weibapi通常会使用postman或者其他模拟http请求的工具去模拟请求。但是这些工具需要自己保存请求地址的url以及参数 每次我都是先查询wiki看参数。

看见同事再用Swashbuckle这个发现特别好用

1、安装 Install-Package Swashbuckle

2、然后F5启动项目 输入 地址 你的地址/swagger

3、 然后就可以愉快的使用了

 

项目地址:https://github.com/domaindrivendev/Swashbuckle

 

ps:  可以将 c.IncludeXmlComments(GetXmlCommentsPath());注释打开 这个会自动根据 注释生成的xml 读取参数的注释

1 private static string GetXmlCommentsPath()
2         {
3             return AppDomain.CurrentDomain.BaseDirectory + @"\bin\项目名称.XML";
4         }

记得在右键项目属性-》生成-》输出 勾选xml文档文件

ps:其他可以打开注释的

c.DisableValidator();

相关文章:

  • 2022-12-23
  • 2021-12-04
  • 2021-06-07
  • 2022-12-23
  • 2022-12-23
  • 2021-04-04
  • 2021-07-19
  • 2021-10-04
猜你喜欢
  • 2021-09-10
  • 2022-12-23
  • 2021-11-25
  • 2021-04-18
  • 2021-05-10
  • 2021-07-21
相关资源
相似解决方案