Closed KalleOlaviNiemitalo closed 4 years ago
ASP.NET Core 2.1 also suffers from https://github.com/aspnet/Mvc/issues/8501, https://github.com/aspnet/Mvc/issues/8467, and https://github.com/aspnet/Mvc/issues/8317, which make it more difficult to return RFC 7807 compliant responses. The ErrorController
sample code in the "Exception handler" section will thus respond with an incorrect Content-Type
when running on ASP.NET Core 2.1.
I think this page should do one of:
ProblemDetails
in an RFC 7807 compliant manner on ASP.NET Core 2.1;ProblemDetails
, if targeting ASP.NET Core 2.1;@KalleOlaviNiemitalo is https://github.com/aspnet/AspNetCore.Docs/pull/14366/files correct? I could restore that for the 2.1 version.
@Rick-Anderson Are you proposing to restore https://github.com/aspnet/AspNetCore.Docs/blob/af85507ca3a3dfbea695082c39457684927f1696/aspnetcore/web-api/handle-errors.md for ASP.NET Core 2.1? It does not seem correct to me. Outside of ::: moniker
sections, it:
I was hoping that was a valid version for 2.1 We could look at previous versions - there should be correct 2.1 information in a previous version - unless it was never updated for 2.1
The file was renamed in that pull request. The history of earlier versions is at https://github.com/aspnet/AspNetCore.Docs/commits/d667d2a7ef96b52e07ea50b99f237fea26b0dd11/aspnetcore/web-api/error-handling.md. All of those versions have the "MVC transforms an error result" paragraph and none of them hides it from ASP.NET Core 2.1.
I think this page should do one of:
- demonstrate how to format
ProblemDetails
in an RFC 7807 compliant manner on ASP.NET Core 2.1;- recommend defining an app-specific type instead of using
ProblemDetails
, if targeting ASP.NET Core 2.1;- recommend upgrading to ASP.NET Core 2.2 or later, if RFC 7807 compliance is desired. (This upgrade may be difficult because ASP.NET Core 2.1 is the last long-time support (LTS) version that can be run on .NET Framework.)
How about this:
recommend upgrading to ASP.NET Core 2.2 or later, if RFC 7807 compliance is desired. If you can't upgrade:
recommend defining an app-specific type instead of using ProblemDetails
,
@JamesNK or @pranavkm is that OK? @scottaddie can you schedule this?
cc @serpent5 if you're interested.
@KalleOlaviNiemitalo out of the box, the type in 2.1 is compliant with the RFC. The 3 issues while good to have would generally not be considered blocking to use the ProblemDetails
type in 2.1.
However, although ASP.NET Core 2.1.12 defines the ProblemDetail type, it never transforms error results to ProblemDetails. That feature was added for ASP.NET Core 2.2, in https://github.com/aspnet/AspNetCore/commit/5bd818bd64641208e52e9350f443d1336f544e41. Please hide the text when ASP.NET Core 2.1 is selected.
Moved to #16385
This text appears even when ASP.NET Core 2.1 is selected as the version:
However, although ASP.NET Core 2.1.12 defines the ProblemDetail type, it never transforms error results to ProblemDetails. That feature was added for ASP.NET Core 2.2, in https://github.com/aspnet/AspNetCore/commit/5bd818bd64641208e52e9350f443d1336f544e41. Please hide the text when ASP.NET Core 2.1 is selected.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.