FromHeader only has a Name property and doesn’t have description. How do I change the description?
FromHeader
Name
public async Task<IActionResult> Test([FromHeader] string Authorization) { }
2
You should include the using System.ComponentModel then add an annotation to the controller method like this:
[Description("This description will appear in docs")] [HttpPost] public async Task<IActionResult> Test([FromHeader] string Authorization) { }
Hope help you.
Updated your csproj to use xml documentation:
Update your program.cs
Then your xml comments will show, like mine:
Click here to cancel reply.
2
Answers
You should include the using System.ComponentModel then add an annotation to the controller method like this:
Hope help you.
Updated your csproj to use xml documentation:
Update your program.cs
Then your xml comments will show, like mine: