ASP.NET Web API - 自动生成API文档 [英] ASP.NET Web API - Automatically generate API documentation

查看:209
本文介绍了ASP.NET Web API - 自动生成API文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用ASP.NET Web API构建一个RESTful API项目。

We are building a RESTful API project using ASP.NET Web API.

我们正在寻找一种简单的方法来为我们公开的每个方法调用自动生成文档在我们的API中,包括HTTP动词,URI,预期参数和样本方法有效负载。

We are looking for an easy way to generate documentation automatically for each method call that we expose in our API including - HTTP verbs, URI, expected parameters and sample method payloads.

任何人都可以推荐一些工具和方法,用于完成ASP.NET Web API项目?

Can anyone recommend some tools and approaches they have used to accomplish this for an ASP.NET Web API project?

有甚么工具可以做到这一点吗?或者是将是一个严格的手动过程?

Are there even tools that will do this? Or is it going to be a disciplined manual process?

推荐答案

webapi团队目前正在开发一个工具来生成文档。该工具称为ApiExplorer。

The webapi team is currently working on a tool to generate documentation. The tool is called ApiExplorer.

http://blogs.msdn.com/b/yaohuang1/archive/2012/05/13/asp-net-web-api-介绍iapiexplorer-apiexplorer.aspx

http://blogs.msdn.com/b/yaohuang1/archive /2012/05/21/asp-net-web-api-generating-a-web-api-help-page-using-apiexplorer.aspx

更新:以下是一些官方文档: http://www.asp.net/web-api/overview/creating-web-apis/creating-api-help-pages

Update: Here is some official documentation: http://www.asp.net/web-api/overview/creating-web-apis/creating-api-help-pages

更新3 / 1/2015 - 有一个名为Swashbuckle的项目,它使用ApiExplorer来生成 Swagger 文件( Github Nuget

Update 3/1/2015 - There is a Project called Swashbuckle that uses ApiExplorer to generate Swagger Docs. (Github, Nuget)

这篇关于ASP.NET Web API - 自动生成API文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆