3

I have a problem with API help page, it works well until I changed the route of API.

Let see this example, I have a booking API for controlling users' booking action:

    public IEnumerable<Booking> Get(string token)
    {
        return BookingRepository.GetBooking(token);
    }

    public string Post([FromBody]AddBookingData data)
    {
        // Do something with the posted booking data
        return null;
    }

And I have a route for getting booking

config.Routes.MapHttpRoute(
            name: "GetBookingOfCustomer",
            routeTemplate: "api/Booking/{customerToken}",
            defaults: new { controller = "Booking", customerToken = RouteParameter.Optional }
        ); 

So the generated page has only 1 documentation for booking, like this :

GET api/Booking/{customerToken}            Documentation for 'Get'.

There is no documentation for POST action. I don't know why. Thank you so much !

jimmy ng
  • 41
  • 3
  • I am unable to repro the issue with your above code...do you have any other routes apart from `GetBookingOfCustomer`?...also you probably meant `Get(string customerToken)` and not `Get(string token)`? – Kiran Jul 22 '14 at 14:58

0 Answers0