In my previous post, Using Microsoft ASP.NET Web API 2 Help Page – Part 2 I mentioned that in MVC5, the HelpPage API, you no longer to specify the response type as part of the HelpPageConfig.
This was simplier than I thought it would be.
Using this GitHub commit of the PolicyController, The Get methods have no attributes. Within HelpPageConfig, we have the following code:
config.SetActualResponseType(typeof(Core.Models.Policy), "Policy", "Get");
This line needs to be removed.
On the PolicyController, add the following attribute to the Get methods
If required add a link to System.Web.Http;
Check the help page, and the samples are displayed correctly. Using Attributes just feels cleaner that adding multiple entries into the HelpPageConfig. Missing the attribute, you know that there will be a problem with the produced api documentation