Skip to content

Response description #63766

@IeuanWalker

Description

@IeuanWalker

Is there an existing issue for this?

  • 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 -

  .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

.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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackThe author of this issue needs to respond in order for us to continue investigating this issue.Needs: ReproIndicates that the team needs a repro project to continue the investigation on this issuearea-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapi

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions