Response description
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 290
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Is your feature request related to a problem? Please describe the problem.
As far as i can see there is no way to provide a description to a response type. The standard `.Produce` methods don't have any parameter for it, and I've even tried this with no luck -
```csharp
.WithOpenApi(operation =>
{
operation.Responses["200"].Description = "Downloadable HTML file containing all todos in a formatted table";
operation.Responses["204"].Description = "No todos available to export";
return operation;
})
```
and
```csharp
.WithMetadata(new ProducesResponseTypeMetadata(StatusCodes.Status200OK, null, ["text/html"]) { Description = "Downloadable HTML file containing all todos in a formatted table" })
```
### Describe the solution you'd like
An extra parameter added to the `.Produces` method to add the description field
### Additional context
Looks like currently internally it populates it with the response status code name. Ideally, we should be able to override it or append to it
Contributor guide
Assessment
This issue has not been assessed yet.