Set content-type to application/problem+json
for generic TypedResults with T=ProblemDetails
#58574
Open
1 task done
Labels
area-minimal
Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc
feature-openapi
Milestone
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
Currently when an endpoint returns a generic TypedResults with T=ProblemDetails, such as
NotFound<ProblemDetails>
,the content-type is set to
application/json
instead ofapplication/problem+json
.The endpoint could set the content-type manually, but it would be nice if the framework could do this automatically.
Note that the generated OpenAPI document currently shows the response as
application/json
, which is correctas long as the endpoint does not set the content-type manually.
Describe the solution you'd like
Set the content-type
application/problem+json
for TypedResults with T=ProblemDetails and reflect this in the OpenAPI document.Additional context
No response
The text was updated successfully, but these errors were encountered: