【问题标题】:ASP.NET Core Web Api automatic help pagesASP.NET Core Web Api 自动帮助页面
【发布时间】:2016-12-08 00:28:55
【问题描述】:

在以前的 ASP.NET 版本中,当我创建 Web Api 2 时,Visual Studio 自动为 API 自动生成文档。

这里也有解释: http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/creating-api-help-pages

我正在编写一个新项目,并决定使用 ASP.NET Core 来完成,但我没有看到任何类似于以前版本中存在的从 API 生成文档的内容(我是也猜测这有点不同,因为所有控制器现在都继承自同一个 Controller 类)。

但是,有没有办法为 ASP.NET Core API 生成帮助文件?

【问题讨论】:

    标签: asp.net asp.net-core asp.net-core-mvc asp.net-core-1.0 asp.net-core-webapi


    【解决方案1】:

    你想要的功能在https://github.com/domaindrivendev/Swashbuckle

    以下链接提供了如何配置和使用精心设计的实用程序的示例 https://damienbod.com/2015/12/13/asp-net-5-mvc-6-api-documentation-using-swagger/

    【讨论】:

      【解决方案2】:

      John Davidson 发表了一篇很好的文章,展示了如何生成 Swagger 文档 - 这很有用而且很棒。

      但如果您想坚持使用 ASP.Net MVC 5 - Api Explorer 文档, 您应该看看那篇优秀的博文:

      https://andrewlock.net/introduction-to-the-apiexplorer-in-asp-net-core/

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2015-11-18
        • 1970-01-01
        • 2014-12-27
        • 2015-04-07
        • 1970-01-01
        • 2013-11-08
        • 2014-10-11
        相关资源
        最近更新 更多