Skip to content

C# acronym normalization ignores management SDK ApiCompat contracts #11696

Description

@live1206

Describe the bug

The acronym normalization introduced by #11641 renames existing public management SDK types and properties even when their original names are present in the package's ApiCompatVersion contract.

The implementation is intended to normalize only new contract names and preserve names found through FindForTypeInLastContract or LastContractView. In a full Azure SDK for .NET management regeneration, that preservation does not occur consistently.

Reproduction

Regenerate Azure SDK management packages using:

Examples where the old name is present in the tagged GA API contract but is still renamed:

Package / ApiCompatVersion Existing contract name Generated name
Azure.ResourceManager.OracleDatabase / 1.2.1 OracleBaseDbSystemShape OracleBaseDBSystemShape
Azure.ResourceManager.Network / 1.16.1 VirtualNetworkApplianceIpVersionType VirtualNetworkApplianceIPVersionType
Azure.ResourceManager.Sql / 1.4.0 SyncMemberDbType SyncMemberDBType
Azure.ResourceManager.SqlVirtualMachine / 1.1.2 SqlVmOsType SqlVMOSType
Azure.ResourceManager.PostgreSql / 1.4.2 PostgreSqlMigrationLogicalReplicationOnSourceDb PostgreSqlMigrationLogicalReplicationOnSourceDB

Machine Learning also renames existing GA properties including PrivateIpAddress, PublicIpAddress, HostIp, OsVhdSizeMB, and IsLatestOsImageVersion.

These changes cause compile failures where custom code or generated compatibility model-factory methods reference the contracted names. They also produce breaking public API changes in packages that otherwise compile.

Expected behavior

If a public type or property exists in the assembly identified by ApiCompatVersion, preserve its existing spelling. Apply acronym normalization only to genuinely new contract members.

Additional context

Names absent from the GA baseline are normalized as expected, so the issue appears specific to last-contract discovery or matching in the management generator integration rather than the normalization rules themselves.

​- 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