Add description to ProducesResponseTypeAttribute #40836
Labels
old-area-web-frameworks-do-not-use
*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Milestone
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
When using the
ProducesResponseTypeAttribute
, the generated OpenAPI doc does only contain a very basic description (Success, etc.). When describing something more elaborate, XML documentation comments have to be used, e. g./// <response code="200">describe something important</response>
. But the value for thecode
attribute only accepts pure numbers, not enums - I cannot write/// <response code="HttpStatusCode.Success">describe something important</response>
. This makes refactoring harder to accomplish.Describe the solution you'd like
Therefore it would be great to have a property like
Description
on theProducesResponseTypeAttribute
. This property could be picked up by Swashbuckle/OpenAPI.The result would look like this:
[ProducesResponseType(HttpStatusCode.Ok, "describe something important")]
Additional context
No response
The text was updated successfully, but these errors were encountered: