You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Restore previous GA parameter names on generated constructors #11588
Existing generated constructors do not restore parameter names from the previous GA contract.
Constructor back-compatibility preserves or adds constructor signatures, but parameter names on a current constructor can still differ from the matching previous-contract constructor. This is source-breaking for callers that use named arguments and is reported by ApiCompat as CP0017.
Evidence
Azure SDK regeneration PR Azure/azure-sdk-for-net#61813 exposed 17 constructor parameter-name mismatches across six services.
Examples:
ContainerAppWorkloadProfile(string, int, int): name, minimumCount, and maximumCount no longer align with their GA positions.
InitialAgentPoolConfiguration(long, ..., string, string): name and vmSkuName are swapped.
InMageRcmFabricCreationContent(...): vmwareSiteId became vMwareSiteId.
VMwareCbtEnableMigrationContent(...): vmwareMachineId became vMwareMachineId.
FhirServiceAccessPolicyEntry(...): serializedAdditionalRawData became additionalBinaryDataProperties.
The C# client emitter's constructor back-compatibility logic preserves constructor signatures but fails to restore parameter names from the previous GA contract, causing source-breaking changes for callers using named arguments (ApiCompat CP0017).
Category: Bug Area: emitter:client:csharp
⚠️ No reproduction provided. A minimal repro would help diagnose this issue.
🔍 Analysis
Affected component: Constructor back-compat code generation in @typespec/http-client-csharp
Root cause: When generating constructors that match a previous-contract signature by parameter types, parameter names are not positionally restored from the GA contract. This includes simple renames, casing changes, and parameter swaps/rotations.
Impact: Source-breaking for consumers using C# named arguments; reported by ApiCompat as CP0017.
📝 Suggested next steps
In the constructor back-compat generation logic, after matching current constructor to previous-contract constructor by parameter types, positionally restore parameter names from the previous contract
Handle swaps and rotations atomically, validating final names are unique
Update XML doc comments and constructor-body references consistently
Add suggested tests: simple rename, casing-only rename, two same-typed params swapped, three same-typed params rotated
FhirServiceAccessPolicyEntry is a model that no longer is defined in the latest version of the service, so the generator omits it. We don't have the functionality in place to correctly restore this entire model from back compat. This one should just be handled via client.tsp or custom code. We can explore how to handle this via back compat if it becomes a recurring pattern.
Activity
github-actions commentedon Aug 7, 2026
🎯 Issue Triage
The C# client emitter's constructor back-compatibility logic preserves constructor signatures but fails to restore parameter names from the previous GA contract, causing source-breaking changes for callers using named arguments (ApiCompat
CP0017).Category: Bug
Area:
emitter:client:csharp🔍 Analysis
@typespec/http-client-csharpCP0017.📝 Suggested next steps
jorgerangel-msft commentedon Aug 10, 2026
FhirServiceAccessPolicyEntry is a model that no longer is defined in the latest version of the service, so the generator omits it. We don't have the functionality in place to correctly restore this entire model from back compat. This one should just be handled via client.tsp or custom code. We can explore how to handle this via back compat if it becomes a recurring pattern.
jorgerangel-msft commentedon Aug 10, 2026
Working on a fix in #11614, pending a regen test
Add Support for More Back Compat Model Ctor Scenarios (microsoft#11614)