I am getting repeat entries rendered in my Web API Help Page with different parents, such as these, that refer to the same method:
GET api/{apiVersion}/v1/Products - Gets all products
...
GET api/v1/Products - Gets all products
...
I have a Web API page with some routing like this:
config.Routes.MapHttpRoute (
name: "DefaultVersionApi",
routeTemplate: "api/{apiVersion}/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
config.Routes.MapHttpRoute (
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
I had thought that this routing would make the "v1" optional, so the derived documentation above is not expected.
(sidebar: Going to api/products
certainly doesn't work, so I am not sure what is wrong with this. What am I missing?)
It seems the real problem is that Web API Help Page is reading the routes improperly, as I thought v1
and {apiVersion}
should not both appear in the same action. What am I missing here?