I'm trying to create documentation for my API's. So far I've tried with Swagger.Net and Web API help pages
Both tools provided me with correct documentation which is generated from XML but both of them showed me duplicate entries. I'm supposing that's related how my routes are configured:
config.Routes.MapHttpRoute(
name: "Sample1",
routeTemplate: "sample1/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
config.Routes.MapHttpRoute(
name: "Sample2",
routeTemplate: "sample2/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
What I see in view is methods both from Sample1 and Sample2, something like this:
../sample1/method1
../sample1/method2
../sample2/method1
../sample2/method2
And I want this:
../sample1/method1
../sample2/method2
Any ideas?
/sample1/method1
, issample1
a controller or ismethod1
a controller...in any case, the way HelpPage works is that it iterates through each route in the route collection and gets all the controllers and actions which can be reached from that route.... – Kiran Challa Jun 11 '13 at 20:26sample1
andsample2
are sub-folders under Controllers, so therefore I've configured two routes. I'm guessing because of that, HelpPage iterates twice through all api controllers. So question would be how to distinct controllers inside those sub folder and not to display duplicate methods? – jasenkoh Jun 11 '13 at 20:39