Skip to content

[http-client-csharp] Preserve cref tags in parameter docs - #11792

Merged
JoshLove-msft merged 1 commit into
microsoft:mainfrom
nightcityblade:fix/issue-11768
Sep 3, 2026
Merged

[http-client-csharp] Preserve cref tags in parameter docs#11792
JoshLove-msft merged 1 commit into
microsoft:mainfrom
nightcityblade:fix/issue-11768

Conversation

@nightcityblade

Copy link
Copy Markdown
Contributor

Fixes #11768

Summary

  • route parameter XML documentation through the existing structured-content processor instead of flattening it with XElement.Value
  • preserve <see cref="..."/> references while retaining the existing type-prefix cleanup
  • add a regression test that fails on main with missing type references and passes with the fix

Testing

  • dotnet test packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Microsoft.TypeSpec.Generator.Tests.csproj --no-restore --filter FullyQualifiedName~NamedTypeSymbolProviders --nologo (78 passed)
  • dotnet format packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.sln whitespace --verify-no-changes --no-restore --include packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/NamedTypeSymbolProvider.cs packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/XmlDocsTests.cs --verbosity minimal
  • git diff --check

Copilot AI lite review requested due to automatic review settings August 30, 2026 15:31
@microsoft-github-policy-service microsoft-github-policy-service Bot added emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp labels Aug 30, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a regression in the C# HTTP client generator where XML <param> documentation was being flattened to plain text, causing <see cref="..."/> references to be silently dropped when reading docs back from symbols (e.g., via last-contract views).

Changes:

  • Updates parameter XML doc extraction to reuse the existing structured XML content processing (instead of XElement.Value), preserving <see cref="..."/> tags while keeping the existing T: prefix cleanup behavior.
  • Adds a regression test to validate that parameter docs retain <see cref="..."/> content after round-tripping through symbol XML docs.

Reviewed changes

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

File Description
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/NamedTypeSymbolProvider.cs Routes <param> doc extraction through ProcessXmlContent so <see cref="..."/> tags are preserved.
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/XmlDocsTests.cs Adds a regression test ensuring parameter descriptions keep <see cref="..."/> references and type-prefix cleanup.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@pkg-pr-new

pkg-pr-new Bot commented Aug 31, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/http-client-csharp@11792

commit: 42f5054

@github-actions

Copy link
Copy Markdown
Contributor

No changes needing a change description found.

@JoshLove-msft
JoshLove-msft added this pull request to the merge queue Sep 3, 2026
Merged via the queue into microsoft:main with commit 45eea52 Sep 3, 2026
28 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

C# emitter: <param> documentation read from LastContractView silently drops <see cref> references

4 participants