Empty model property description on ASP.NET Web API Help Pages

1.5k views Asked by At

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

There are 2 answers

1
alltej On

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.

1
alltej On

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")));