Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing swagger REST descriptions for Web Api

I followed the guide here: http://bitoftech.net/2014/08/25/asp-net-web-api-documentation-using-swagger/

I put in the following XML comments:

    /// <summary>
    /// Add new student
    /// </summary>
    /// <param name="student">Student Model</param>
    /// <remarks>Insert new student</remarks>
    /// <response code="400">Bad request</response>
    /// <response code="500">Internal Server Error</response>

Why do I not get any descriptions? The response codes don't show up either. screenshot

like image 768
Ramin Avatar asked May 05 '26 01:05

Ramin


1 Answers

Enable XML documentation for your subproject (from project properties / build) like you have for your Web API project. Except this time, route it directly to XmlDocument.xml so that it gets generated in your project's root folder.

like image 138
Leandro Bardelli Avatar answered May 08 '26 14:05

Leandro Bardelli



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!