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 !

4

0 回答 0