1

I have multiple controller endpoints with routes like this:

[Route("api/myobjects/action1/action2/{objectIds}")]

They all have method signatures like this (access modifier and return type omitted):

Post([ModelBinder(typeof(CommaDelimitedArrayModelBinder))] int[] objectIds)

The custom modelbinder allows me to post to the endpoint like so:

../api/myobjects/action1/action2/1,2,3

This works great! However, all these methods are ignored by the help pages documentation generating process.

If I remove the modelbinder attribute like so:

Post(int[] objectIds)

It still does not work. Only if I add [FromUri] to the parameter and delete {objectIds} from the route attribute it will work:

Post([FromUri] int[] objectIds)

But this generates a uri that is unwanted like so:

../api/myobjects/action1/action2?objectIds[0]={objectIds[0]}&objectIds[1]={objectIds[1]}

How can I get the help pages documentation process to recognise my endpoints?

transporter_room_3
  • 2,583
  • 4
  • 33
  • 51

1 Answers1

0

You need to update HelpPageConfig like config.SetActualResponseType(typeof(ObjectType), "Object", "MethodName");

using this you can enable help for respective URL in web api

Tayyab
  • 51
  • 9
  • Sadly, this has no effect on the problem I'm experiencing. I tried both config.SetActualResponseType and config.SetActualRequestType. – transporter_room_3 Aug 26 '15 at 17:57
  • if you are using web api 2, there is a nuget package u can install to show help pages, it will automatically find the end points, sorry for so delay in reply – Tayyab Aug 27 '15 at 12:41