Skip to content

RequestDelegateFactory should infer IProducesResponseTypeMetadata #43675

Closed
@halter73

Description

@halter73

Is your feature request related to a problem? Please describe the problem.

RequestDelegateFactory already infers IAcceptsMetadata when it's reading JSON request bodies or multipart form data, so it's peculiar that it does not infer IProducesResponseTypeMetadata when our TypedResults do.

I don't think many people will expect us to infer response type metadata when returning a TypedResult like Ok<MyType> or Task<Ok<MyType>>, but not infer any response metadata when returning MyType or Task<MyType>. I think this is a weird gap.

Describe the solution you'd like

RequestDelegateFactory should infer and add "application/json" ProducesResponseTypeMetadata with the appropriate return Type if it can be inferred while creating the RequestDelegate in AddResponseWritingToMethodCall.

Metadata

Metadata

Assignees

Labels

area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcenhancementThis issue represents an ask for new feature or an enhancement to an existing onefeature-minimal-actionsController-like actions for endpoint routingold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions