webapi 利用webapiHelp和swagger生成接口文档

webapi 利用webapiHelp和swagger生成接口文档。均依赖xml(需允许项目生成注释xml)

webapiHelp:微软技术自带,仅含有模块、方法、请求-相应参数的注释。

swagger:除了上述,还可以执行请求、获取响应等

详细可看代码:https://gitee.com/nlh774/AspNetWebApiStudy   我是分步骤提交git的,所以应该很清楚。

后期该项目会不断扩充,作为个人持续研究webapi的笔记

 

另外,还可以利用vs2017 添加rest api客户端  生成调用方法,我自己写的demo   https://gitee.com/nlh774/AspNetWebApiStudy

主要参考 https://www.red-gate.com/simple-talk/dotnet/net-development/visual-studio-2017-swagger-building-documenting-web-apis/

以下2篇了解即可,没多大用暂时

https://code-maze.com/different-ways-consume-restful-api-csharp/

https://docs.microsoft.com/en-us/dotnet/csharp/tutorials/console-webapiclient

 

webapi目前我个人只是了解阶段,还不能大规模应用。其实我看上的是他的Rest风格+swaggerUI+vs2017“添加rest api客户端“生成调用方法,非常节省开发对接时间。

本人目前对MVC的api熟悉(就是本质是asp.net MVC,只是返回json)

 

posted on 2018-12-20 14:19  nlh774  阅读(323)  评论(0编辑  收藏  举报