-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Labels
area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapihelp wantedUp for grabs. We would accept a PR to help resolve this issueUp for grabs. We would accept a PR to help resolve this issue
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
A Description parameter was added to ProducesResponseTypeAttribute in .NET 10 to set the description
field of the response in the generated OpenAPI document. This works fine in a controller-based app but does not seem to work in a Minimal API app.
Expected Behavior
The ProducesResponseTypeAttribute, when placed on the delegate parameter of a minimal API app endpoint, should add a description to the response in the generated API.
app.MapGet("/weatherforecast",
[ProducesResponseType<IEnumerable<WeatherForecast>>(StatusCodes.Status200OK, Description = "The service is healthy.")]
() =>
{
Steps To Reproduce
I've reproduced the problem in the project in this repo:
https://github.com/mikekistler/ResponseDescription
The problem exists for both the OpenAPI generated at build time and the OpenAPI served from the /openapi/v1.json endpoint.
Exceptions (if any)
No response
.NET Version
10.0.100-preview.1.25104.26
Anything else?
No response
Metadata
Metadata
Assignees
Labels
area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapihelp wantedUp for grabs. We would accept a PR to help resolve this issueUp for grabs. We would accept a PR to help resolve this issue