Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web Api Help Page - Show only some controllers but no others

I've an application made in Web Api 2.1 (Visual Studio 2012 C#) and I made a Help page with XML Documentation.

I just want only expose some controllers, not all controllers of my Web Api, but at the same time I don't want to remove the comments from the methods, classes, properties, etc.

How can I select some elements and others not to show in my help?

Thanks in advance

like image 733
Leandro Bardelli Avatar asked Nov 26 '14 16:11

Leandro Bardelli


1 Answers

For every API controller that you would like to have excluded from the auto generated help pages you should add the following attribute to your controller:

 [ApiExplorerSettings(IgnoreApi = true)]  


P.S. You have to include the following using statement:

System.Web.Http.Description

like image 69
mreyeros Avatar answered Nov 15 '22 20:11

mreyeros