fix(http-client-csharp): use current operation docs for compatibility overloads - #11995
Merged
JoshLove-msft merged 2 commits intoSep 16, 2026
Conversation
Build all shared operation compatibility documentation from the current method, mapping parameter docs and exception references to the preserved signature without mutating primary docs. Cover structured metadata, missing docs, nullable shims, client post-processing, and released DLL/XML baseline round trips. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
JoshLove-msft
requested review from
Jorge Rangel (jorgerangel-msft),
Jose Arriaga Maldonado (joseharriaga),
Jesse Squire (jsquire) and
m-nash
as code owners
September 16, 2026 17:38
commit: |
Contributor
|
No changes needing a change description found. |
Remove the four guide lines added by the operation compatibility documentation fix, as requested. Preserve the implementation and regression tests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved issues remain, and comprehensive regression coverage is included.
Pull request overview
Updates C# compatibility overloads to use current operation XML documentation while preserving legacy signatures and forwarding behavior.
Changes:
- Reworked shim documentation and exception mapping.
- Added published-baseline regression coverage.
- Documented the updated compatibility behavior.
File summaries
| File | Description |
|---|---|
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Utilities/TestData/BackCompatHelperTests/CompatibilityDocumentationIsStableAcrossPublishedBaselines/OperationClient.cs |
Provides stale published-documentation baseline fixtures. |
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Utilities/BackCompatHelperTests.cs |
Adds compatibility documentation regression tests. |
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Utilities/BackCompatHelper.cs |
Builds filtered shim documentation from current methods. |
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Statements/XmlDocParamStatement.cs |
Preserves parameter documentation content. |
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Statements/XmlDocExceptionStatement.cs |
Preserves exception reasons and remaps parameter references. |
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderTests.cs |
Verifies behavior through client processing. |
packages/http-client-csharp/generator/docs/backward-compatibility.md |
Documents the updated compatibility behavior. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Jorge Rangel (jorgerangel-msft)
approved these changes
Sep 16, 2026
JoshLove-msft
enabled auto-merge
September 16, 2026 19:31
JoshLove-msft
deleted the
joshlove-msft-csharp-operation-compatibility-docs
branch
September 16, 2026 20:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11994
Summary
The shared C# generator now builds documentation for added-optional-parameter, nullable-value-type, and reduced-arity compatibility overloads from the current method, rather than documentation reconstructed from the released contract.
creftags, returns, and custom exception reasons.Released contract DLL/XML inputs are selected by
ApiCompatVersion. This repairs stale metadata and indentation across release/baseline round trips; it does not assume that repeated generation against an unchanged baseline adds whitespace.Regression coverage
22 new regression cases cover sync/async optional-parameter shims; legacy continuation indentation; current structured metadata and
cref/return content; parameter-name normalization, reserved names, parameter filtering and exception reasons; unchanged primary docs; nullable/reduced-arity shims; absent/empty/inherited documentation; and preservation through parameter reordering and client suppression processing.The baseline regression compiles DLL and XML documentation, reloads that released contract through Roslyn metadata, and repeats across successive baselines. Rendered shim docs remain identical and current, and compilation checks reject invalid parameter documentation references.
Validation
npm run buildnpm run test:emittereng/scripts/Generate.ps1pnpm formatand packagenpm run formatdotnet format whitespace --verify-no-changeson changed C# filesnpm run copcop checks passed.oxlinton the emitterEnvironment notes: full generator suites used a temporary short drive mapping to this same worktree to avoid existing Windows long-path/mixed-separator test-data failures; the mapping was removed afterward. Repository-pinned pnpm 11.10 was invoked locally without replacing global pnpm, and command-local
NODE_OPTIONS=--experimental-strip-typesenabled the installed Node 22.14 to load the repository's TypeScript tooling.npm run lintstill refers to unavailable ESLint despite the repository's move to oxlint; the current repository oxlint check was run instead. No dependency manifests, lockfiles, global tools, or CI configuration were changed.