2017-02-03 29 views
0

當我通過Swagger啓用此文檔功能時,我可以看到有關我的文檔的所有類型信息,但沒有關於我的控制器名稱詳細信息/說明的詳細信息。WebApi控制器摘要未顯示在Swagger文檔中

如何顯示控制器文檔內容,如下面的例子?

/// <summary> 

/// Represents the alert api controller class. 

/// <summary> 

public class XYZController : ApiController 
{ 

} 

上啓用招搖,我無法看到此內容在任何地方Represents the XYZ api controller class. here

但是我能看到我所有的方法描述。

回答

0

SwaggerConfig類中存在以下代碼嗎?

GlobalConfiguration.Configuration 
      .EnableSwagger(c => 
       { 

        c.IncludeXmlComments(string.Format(@"{0}\bin\YourAssemlyName.XML", System.AppDomain.CurrentDomain.BaseDirectory)); 
0

我認爲這是關係到以下問題: https://github.com/domaindrivendev/Swashbuckle/issues/572

這是目前無法顯示控制器彙總,根據維護者:

The reason this has been low on the priority list is because it's not something I've run into issues with. You can absolutely describe what every action in your API does using XML comments on your actions.