ASP.Net Web API Help Pages: Document complex type properties

asp.net-web-api

Solution

Currently this is not supported out of the box. There is a related work item which asks for help page generation for data annotation attributes used on a model. Your scenario should work afters its fixed: http://aspnetwebstack.codeplex.com/workitem/877

Problem

I have a post action receiving a FromBody-parameter of type Person. In the HelpPage I get information about the Person paramater. Is it possible to list information about the properties in Person instead and use documentation from XML documentation file to get descriptions for each property? ``` public class PersonController : ApiController { /// <summary> /// Add a person /// </summary> /// <param name="person">Person to add</param> /// <returns></returns> [HttpPost] public HttpResponseMessage Add([FromBody] Person person) { // ... return Request.CreateResponse(HttpStatusCode.Created); } } /// <summary> /// A person /// </summary> public class Person { /// <summary> /// The name of the person /// </summary> public String Name { get; set; } /// <summary> /// The age of the person /// </summary> public Int32 Age { get; set; } } ```

Original source