I have a project where I want to use custom attributes of a route. The following code, in which I have a custom type as a query parameter, works fine, and the help page displays a custom type.
// GET api/values?5,6 [Route("api/values")] public string Get(IntegerListParameter ids) { return "value"; }
WebApi.HelpPage provides the following documentation Help: Page
If I change the code to use route attributes, the result is that I get a blank help page.
// GET api/values/5,6 [Route("api/values/{ids}")] public string Get(IntegerListParameter ids) { return "value"; }
When I check the code that I observe in HelpController.cs, ApiExplorer.ApiDescriptions returns an empty ApiDescriptions collection
public ActionResult Index() { ViewBag.DocumentationProvider = Configuration.Services.GetDocumentationProvider(); Collection<ApiDescription> apiDescriptions = Configuration.Services.GetApiExplorer().ApiDescriptions; return View(apiDescriptions); }
Is there a way to make ApiExplorer recognize my own IntegerListParameter class as attribute routing?
source share