3

Introduction

I've followed this tutorial to setup my ASP.NET Web API Help Pages.

Using <package id="Microsoft.AspNet.WebApi.HelpPage" version="5.2.3" targetFramework="net452" />

The documentation seems to be fine, but I'm getting empty model property descriptions.

They are empty in both controller method/endpoint and model details doc.

Controller method example

/// <summary>
/// POST: api/remitent
/// </summary>
/// <param name="remitent"></param>
public void Post([FromBody]Remitent remitent)
{

}

Model property example

/// <summary>
/// First name property summary
/// </summary>
[Required]
[MaxLength(49)]     
public string FirstName { get; set; }

Results

I would expect the FirstName property summary to fill the model property description on docs. Instead the description column is empty: enter image description here


Does anyone know how to solve that?

2 Answers2

2

Did you uncomment this line of code in Areas/HelpPage/App_Start/HelpPageConfig.cs:

config.SetDocumentationProvider(new XmlDocumentationProvider(
    HttpContext.Current.Server.MapPath("~/App_Data/XmlDocument.xml")));
alltej
  • 6,787
  • 10
  • 46
  • 87
0

Can you use Swashbuckle instead of Microsoft.AspNet.WebApi.HelpPage. I find Swashbuckle provides better documentation and friendly UI to explore your API. You can also use it to test your API.

alltej
  • 6,787
  • 10
  • 46
  • 87
  • 1
    I appreciate the [swashbuckle](https://github.com/domaindrivendev/Swashbuckle) alternative, seems to have a lot of features. I'm even using swagger docs for other projects. I will consider for the future, but would first like to solve the web api help issue. – Maximiliano Ejberowicz Jul 22 '16 at 20:36