Skip to content

Document built-in transforms for YARP direct forwarding - #37779

Merged
guardrex merged 8 commits into
dotnet:mainfrom
valkiara:codex/yarp-structured-transforms-docs
Oct 7, 2026
Merged

guardrex merged 8 commits into
dotnet:mainfrom
valkiara:codex/yarp-structured-transforms-docs

Conversation

@valkiara

@valkiara valkiara commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Contributes to dotnet/yarp#2291

Document how to use built-in transforms with IHttpForwarder by creating an HttpTransformer with ITransformBuilder.Create. The example removes param1 and replaces area, and explains service registration, transformer reuse, and default forwarding headers.

Changes:

  • direct-forwarding.md: Add the example and link to the transform defaults.
  • transforms.md: Explain direct forwarding and link to the example.
  • direct-forwarding/snippets/10.0/Program.cs: Add the runnable example used by the documentation snippets.
  • direct-forwarding/snippets/10.0/StructuredTransforms.csproj: Build the example against .NET 10 and Yarp.ReverseProxy 2.3.0.

Validation:

  • Release build with warnings treated as errors: 0 warnings and 0 errors. Used cached NuGet packages because online restore failed with a local TLS error.
  • Executed the documented snippets through IHttpForwarder: verified query removal and replacement, preservation of other query values, transformer reuse, default forwarding headers, and response forwarding.
  • Checked snippet sources and markers, article cross-references and anchors, metadata, and git diff whitespace.
  • Built and visually inspected DocFX previews. Before and after builds have the same 44 existing warning messages. The preview expands Microsoft Learn code directives locally; the publisher's native snippet processing and OpenPublishing checks remain to be verified by PR CI.

Internal previews

File Preview link
aspnetcore/fundamentals/servers/yarp/direct-forwarding.md Learn preview
aspnetcore/fundamentals/servers/yarp/direct-forwarding/snippets/10.0/Program.cs Learn preview
aspnetcore/fundamentals/servers/yarp/transforms.md Learn preview

Build report

@valkiara

valkiara commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

@dotnet-policy-service agree

@valkiara
valkiara marked this pull request as ready for review October 6, 2026 14:52

@guardrex guardrex left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I just have a few NITs, and then we'll get a Copilot look at this.

@valkiara
valkiara requested a review from guardrex October 7, 2026 07:14

@guardrex guardrex left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ooops! I missed one suggestion on cross-linking the section with the example. It helps readers get to whatever "preceding" is referring to when it isn't immediately above the remark.

This comment was marked as resolved.

Update the date for the YARP Direct Forwarding article.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

@guardrex guardrex left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm not going to sweat the other date. One day isn't a concern here for long-term tracking.

@guardrex
guardrex merged commit 1e3cbb8 into dotnet:main Oct 7, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants