dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.23k stars 9.95k forks source link

Minimal APIs should return the standard media type for Problem Details responses #36557

Closed DamianEdwards closed 3 years ago

DamianEdwards commented 3 years ago

Minimal APIs that return the result of calling Microsoft.AspNetCore.Http.Results.ValidationProblem get a response media type of application/validationproblem+json which is not compliant with the RFC7807 spec that they're based on. The media type should be application/problem+json.

MVC has the same incorrect behavior but has since it was introduced in 2.x (see #36560).

We should fix this behavior in .NET 6.0 before final release.

captainsafia commented 3 years ago

Closing since it has been merged to RC2.