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?

8
  • I have the same issue, did you find a solution? Commented May 20, 2017 at 6:56
  • @bit Unfortunately I didn't. Commented May 20, 2017 at 17:24
  • Experienced the same problem. If you peek into the generated xml file, there is no info about the models. Commented Jan 15, 2018 at 5:54
  • @MaximilianoEjberowicz see the answer to this question: stackoverflow.com/questions/30562235/… Commented Jan 15, 2018 at 6:04
  • @foresightyj it works! Models and Web API were in different projects. Commented Feb 9, 2018 at 12:12

2 Answers 2

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")));
Sign up to request clarification or add additional context in comments.

1 Comment

Yes I did, followed all the steps mentioned in the tutorial.
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.

1 Comment

I appreciate the 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.