0

I want to show request and response body as parameter not as raw data . For that I have followed Generate Description Fields for Body Parameters answer but not get success , still showing

enter image description here

/// <summary>
    /// Gets some very important data from the server.
    /// </summary>
    /// <param name="reqData">A Test Model</param>
    [HttpPost]
    public AccountService.GetAccountList_ResponseData GetAccountList([FromBody] AccountService.GetAccountList_ReqestData reqData)
    {
    }
    
    //--my modal
    public class GetAccountList_ReqestData 
    {
        /// <summary>
        /// StartDate 
        /// </summary>
        /// <param name="StartDate">Describe parameter.</param>
        public string StartDate { get; set; }
    }
   
   //---Also enabled 
   config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath("~/App_Data/WebApi.xml")));
pramod maurya
  • 123
  • 2
  • 2
  • 11

1 Answers1

0

You have to add XmlDocs to your class GetAccountList_RequestData

/// <summary>
/// My requestData model
/// </summary>
/// <param name="reqData">The description you want </param>
public class GetAccountList_ReqestData 
{
   /// <summary>
   /// StartDate 
   /// </summary>
   /// <param name="StartDate">Describe parameter.</param>
   public string StartDate { get; set; }
}

You followed the steps correctly, however the person asking in the other thread was displaying a property. You on the other hand are asking for an object, which is your class. Therefor the xmldocs of the class will be used to generate the descriptions.

klekmek
  • 533
  • 3
  • 11