Closed
Description
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
Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etcThis issue represents an ask for new feature or an enhancement to an existing oneController-like actions for endpoint routing*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels