Skip to content

Revert "Fixes Problem Details casing bug (#59396)"#67011

Open
Youssef1313 wants to merge 2 commits into
mainfrom
revert-59876-main
Open

Revert "Fixes Problem Details casing bug (#59396)"#67011
Youssef1313 wants to merge 2 commits into
mainfrom
revert-59876-main

Conversation

@Youssef1313
Copy link
Copy Markdown
Member

@Youssef1313 Youssef1313 commented Jun 4, 2026

Reverts #59876

Fixes #65543
Fixes #66603

This resolves the inconsistency of how the naming policy is applied and we let STJ do its thing. Note that the STJ behavior here looks intentional dotnet/runtime#31167. Given that this can't round trip correctly, and that the current behavior is already very inconsistent, I think it's better to revert to the original behavior.

Copilot AI review requested due to automatic review settings June 4, 2026 06:38
@github-actions github-actions Bot added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Jun 4, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Reverts the prior change that applied JsonSerializerOptions.PropertyNamingPolicy to the traceId extension key in DefaultProblemDetailsWriter, restoring consistent traceId casing and aligning with how System.Text.Json treats JsonPropertyName and extension-data keys for ProblemDetails.

Changes:

  • Always writes the trace identifier under the literal "traceId" extension key (no naming policy conversion).
  • Removes the test that asserted traceId key casing changes with different JsonNamingPolicy values.
  • Minor adjustments to casing-related assertions in existing tests.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/Http/Http.Extensions/src/DefaultProblemDetailsWriter.cs Reverts naming-policy-based traceId key generation; always uses "traceId".
src/Http/Http.Extensions/test/ProblemDetailsDefaultWriterTest.cs Removes naming-policy casing theory; keeps/updates casing assertions for "traceId".

Comment thread src/Http/Http.Extensions/test/ProblemDetailsDefaultWriterTest.cs
Comment thread src/Http/Http.Extensions/test/ProblemDetailsDefaultWriterTest.cs
@Youssef1313 Youssef1313 added feature-problem-details area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc and removed area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions labels Jun 4, 2026
Comment thread src/Http/Http.Extensions/src/DefaultProblemDetailsWriter.cs
@Youssef1313 Youssef1313 requested a review from BrennanConroy June 4, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc feature-problem-details

Projects

None yet

3 participants