Skip to content

Description parameter of ProducesResponseTypeAttribute does not work in minimal API app #60518

@mikekistler

Description

@mikekistler

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

No one assigned

    Labels

    area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapihelp wantedUp for grabs. We would accept a PR to help resolve this issue

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions