You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current middleware implementation allows to send in ProblemDetails:
a) only Title (default option for Production)
title is constructed automatically from the status code name
Detail property is not filled
b) Title, Details and a lot of exception details and method context and lines of source code etc. (default option for Development
details is taken from the original exception message
Sometimes it is convenient for a client to know at least a bit of what happened, thus send Detail in the ProblemDetail in Production.
Suggested new option:
c) Title and Detail for Production environment
Title - automatically as status code name (same as now)
Detail - original exception message
Public API changes (new), no modification of the original public API is required (no breaking change):
The text was updated successfully, but these errors were encountered:
janseris
changed the title
ProblemDetails middleware allow send Detail property out of the box in Production
[Feature request] ProblemDetails middleware allow send Detail property out of the box in Production
Apr 28, 2023
The current middleware implementation allows to send in ProblemDetails:
a) only
Title
(default option for Production)Detail
property is not filledb)
Title
,Details
and a lot of exception details and method context and lines of source code etc. (default option for DevelopmentSometimes it is convenient for a client to know at least a bit of what happened, thus send
Detail
in theProblemDetail
in Production.Suggested new option:
c)
Title
andDetail
for Production environmentTitle
- automatically as status code name (same as now)Detail
- original exception messagePublic API changes (new), no modification of the original public API is required (no breaking change):
ProblemDetailsOptions.MapToStatusCodeWithDetail<TException>(int statusCode)
as an alternative for the current API:
ProblemDetailsOptions.MapToStatusCode<TException>(int statusCode)
Example:
Reference implementation which already contains this behavior:
https://stackoverflow.com/a/74487747
The text was updated successfully, but these errors were encountered: