Web API Help Pages

This feature of Web API seems to be still in the alpha phase. Not all required features are implemented, it has NO SUPPORT for self hosted Web API services. A lot of the links about this are old and the most projects examples don’t work with the latest Web API version. The official ASP.NET HOWTO does work but just for MVC or IIS applications.

Adding help to a MVC application

This works as described on the ASP.NET Web API page. When you add the NuGet package to the MVC project, you have to edit your project file in the build section and also uncomment the help config, and add your xml filename. This package only works with MVC.

HelpPageConfig.cs File
WebApiDoc01

Project file:
WebApiDoc02

Filip W. also explains the new features for Web API Help pages included in Web API 2.1.

Self Hosted Web API help pages or the lack of them…

At present it is NOT possible to create automatic help documentation for a self hosted Web API service. This is very disappointing but I suppose you can always create your own. Some old links exist for this, but the projects do not work anymore.

Links:

http://bitoftech.net/2014/08/25/asp-net-web-api-documentation-using-swagger/

http://visualstudiomagazine.com/articles/2014/09/01/web-api-documentation-tools.aspx

http://blogs.msdn.com/b/yaohuang1/archive/2013/01/20/design-time-generation-of-help-page-or-proxy-for-asp-net-web-api.aspx

http://code.msdn.microsoft.com/Design-time-help-page-3048fb43

http://thesoftwaredudeblog.wordpress.com/2013/12/02/documenting-the-webapi-using-microsoft-asp-net-web-api-2-help-page/

http://www.strathweb.com/2014/01/return-types-action-parameters-and-data-annotations-now-available-in-web-api-2-1-help-page/

http://www.asp.net/web-api/overview/creating-web-apis/creating-api-help-pages

http://blogs.msdn.com/b/yaohuang1/archive/2012/12/20/making-asp-net-web-api-help-page-work-on-self-hosted-services.aspx

http://msdn.microsoft.com/en-us/library/b2s063f7.aspx

http://blogs.msdn.com/b/yaohuang1/archive/2012/12/20/making-asp-net-web-api-help-page-work-on-self-hosted-services.aspx

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: