Skip to content

[http-client-csharp] Url-to-Uri last-contract guard misses management methods and enum values #11708

Description

@live1206

Describe the bug

The Url-suffix normalization introduced by #11642 correctly includes a last-contract compatibility guard, but that guard does not preserve several shipped Azure management SDK methods and enum values.

A full management regeneration renames existing public Url symbols to Uri, causing ApiCompat failures and source-breaking changes.

Reproduction

Regenerate the Azure SDK for .NET management libraries using:

The previous regeneration used generator packages from 20260812, before #11642 was merged.

Existing methods that are renamed

Package Existing public API Regenerated API
Azure.ResourceManager.Network GetVpnProfilePackageUrl / GetVpnProfilePackageUrlAsync GetVpnProfilePackageUri / GetVpnProfilePackageUriAsync
Azure.ResourceManager.AppService GetCallbackUrl / GetCallbackUrlAsync GetCallbackUri / GetCallbackUriAsync
Azure.ResourceManager.ContainerRegistry.Tasks GetLogSasUrl / GetLogSasUrlAsync GetLogSasUri / GetLogSasUriAsync
Azure.ResourceManager.ContainerRegistry.Tasks GetBuildSourceUploadUrl / GetBuildSourceUploadUrlAsync GetBuildSourceUploadUri / GetBuildSourceUploadUriAsync

The Container Registry operation is surfaced both through the mockable resource-group wrapper and public extension methods, producing ten changed public method declarations in total across the affected packages.

Network locally reports CP0002 for the removed GetVpnProfilePackageUrl methods.

Existing enum values that are renamed

Package/type Existing value Regenerated value
Azure.ResourceManager.SecurityInsights.Models.RestApiPollerRequestPagingKind NextPageUrl NextPageUri
Azure.ResourceManager.SecurityInsights.Models.SecurityInsightsEntityType Url Uri

Likely cause

#11642 checks ClientProvider.LastContractView.Methods before normalizing operation names. Management resource, mockable-resource, and extension methods are synthesized on wrapper providers, so their shipped method names may not exist on the underlying client provider's last-contract view where normalization occurs.

For enum values, the LastContractView field/property lookup also appears not to resolve the final management enum contract in these cases.

The management NameVisitor is not involved in these failures: its Url logic applies only to model type and property names. The affected methods and enum values use the core generator paths added by #11642.

Expected behavior

If the final public management API contains a matching Url-suffixed method or enum value in the assembly identified by ApiCompatVersion, preserve that shipped name. Apply Url → Uri only to genuinely new operations and enum values.

Please add management coverage for synthesized resource/extension methods and management enum values, in addition to the direct client tests added by #11642.

Related management last-contract issue: #11696.

​- by copilot

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingemitter:client:csharpIssue for the C# client emitter: @typespec/http-client-csharp

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions