Skip to content

C# generator: omit removed types from BinaryData union documentation #11342

Description

@live1206

Description

When a BinaryData property carries union-item metadata, its generated XML documentation can list a generated type that the provider reference map later removes. The current writer avoids an invalid cref by rendering the removed type as <c> text, but the resulting documentation may still advertise a type that users cannot access.

Constraint

PropertyDescriptionBuilder.CreateBinaryDataExtraDescription and GetUnionTypes run while providers and property descriptions are being built. The provider reference map determines removal only afterward, once all providers and their dependencies have been built and analyzed. Therefore, checking ProviderReferenceMapAnalyzer.IsRemovedTypeReference while constructing the description is too early and cannot reliably filter the item.

Expected fix

Introduce a generic write-time or post-analysis mechanism that omits removed union-item types from generated BinaryData documentation while preserving valid union descriptions. This should not special-case a service or type name, and should retain the current protection against unresolved XML cref links in other documentation contexts.

Follow-up from #11288 and review comment #11288 (comment).

Metadata

Metadata

Assignees

Labels

emitter:client:csharpIssue for the C# client emitter: @typespec/http-client-csharpfeatureNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions