File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/Http/Http.Extensions/src Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -56,16 +56,17 @@ public ValueTask WriteAsync(ProblemDetailsContext context)
5656 ProblemDetailsDefaults . Apply ( context . ProblemDetails , httpContext . Response . StatusCode ) ;
5757
5858 var traceId = Activity . Current ? . Id ?? httpContext . TraceIdentifier ;
59- var tradeIdKeyName = _serializerOptions . PropertyNamingPolicy . ConvertName ( "traceId" ) ;
59+
60+ var traceIdKeyName = _serializerOptions . PropertyNamingPolicy ? . ConvertName ( "traceId" ) ?? "traceId" ;
6061 context . ProblemDetails . Extensions [ traceIdKeyName ] = traceId ;
6162
6263 _options . CustomizeProblemDetails ? . Invoke ( context ) ;
6364
6465 var problemDetailsType = context . ProblemDetails . GetType ( ) ;
6566
6667 return new ValueTask ( httpContext . Response . WriteAsJsonAsync (
67- context . ProblemDetails ,
68- _serializerOptions . GetTypeInfo ( problemDetailsType ) ,
69- contentType : "application/problem+json" ) ) ;
68+ context . ProblemDetails ,
69+ _serializerOptions . GetTypeInfo ( problemDetailsType ) ,
70+ contentType : "application/problem+json" ) ) ;
7071 }
7172}
You can’t perform that action at this time.
0 commit comments