I have a question about ASP.NET Web API HelpPages.
Usually HelpPages can generate the WebAPI by XMLDocumentation Sample Code:
public class ValueControllerBase : ApiController
{
/// <summary>
/// Base Do
/// </summary>
public IEnumerable<string> Do()
{
return new string[] { "value1", "value2" };
}
}
public class ValuesController : ValueControllerBase
{
/// <summary>
/// Testing API
/// </summary>
public string Get(int id)
{
return "value";
}
}
this can generate successfully, like this:
API
GET api/Values/Get/{id}
Description
Testing API
API
POST api/Values/Do
Description
Base Do
but if I use a generic base controller, it will not generate the API Document.
Sample:
public class ValueControllerBase<T> : ApiController
{
/// <summary>
/// Base Do
/// </summary>
public IEnumerable<string> Do()
{
return new string[] { "value1", "value2" };
}
}
public class ValuesController<String> : ValueControllerBase
{
/// <summary>
/// Testing API
/// </summary>
public string Get(int id)
{
return "value";
}
}
If I use the code at the second section, HelpPages can generate the API document, but doesn't generate the API annotation. The difference between my two examples is just second section code use a generic type.
API
GET api/Values/Get/{id}
Description
Testing API
API
POST api/Values/Do
Description
null
In the method Do()
, the annotation doesn't display compared with the first
Is there any solution to fix these problems?