Search code examples
c#asp.netasp.net-mvc-apiexplorer

Generate Description Fields for Body Parameters


So I've been Googling a lot to try and solve this problem but I can't seem to find anything on it. See picture for reference, but I'm trying to fill in the Description field for the body parameters. What is the best way to do this?

missing body parameter description


Solution

  • Alright so I figured this out, hopefully this can help someone else who comes across this. The first thing you want to do is follow this link to enable XML Documentation for ApiExplorer. After you enable that you want to add

    /// <summary>Description</summary>
    

    Above your controller names (you can add param names as well in your xml by adding another line <param name="model">A Test Model</param>)

    Then head to your models and for each parameter inside your model add a summary tag again, like so:

    public class TestModel()
    {
    /// <summary>This is your IdNumber you received earlier</summary>
    public string IdNumber {get;set;}
    }