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 }}
This repository was archived by the owner on Jun 16, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Jun 16, 2026. It is now read-only.
[Feature] Fix the renamed parameter model name #3599
The codegen can auto rename a model to XXXXContent if this model is only referenced once and the suffix is Parameter .
Then if this model is used in other operations in the new swagger, then this renaming mechanism will fail and cause breaking change.
The codegen should keep this kind of renames in any new versions.
Investigated the MPG generator (eng/packages/http-client-csharp-mgmt in azure-sdk-for-net). The legacy autorest.csharp behavior — renaming a model to XXXContent when it's referenced only once and has a Parameter suffix — does not exist in MPG.
Instead, MPG's NameVisitor renames resource update-body models deterministically based on semantic role, not reference count:
{Resource}CreateOrUpdateContent when the model is used as both create and update body
{Resource}Patch when only used as the patch/update body
Honors @@clientName overrides on the patch-only path
Because the rename is anchored to resource/role semantics rather than usage count, the breaking-change scenario described here (rename flipping when a model becomes referenced by additional operations in a new version) doesn't apply to MPG. I think this issue can be closed as not applicable to MPG.
Activity
ArthurMa1978 commentedon May 8, 2025
This will move to MPG.
haiyuazhang commentedon May 14, 2026
Investigated the MPG generator (eng/packages/http-client-csharp-mgmt in azure-sdk-for-net). The legacy autorest.csharp behavior — renaming a model to
XXXContentwhen it's referenced only once and has aParametersuffix — does not exist in MPG.Instead, MPG's
NameVisitorrenames resource update-body models deterministically based on semantic role, not reference count:{Resource}CreateOrUpdateContentwhen the model is used as both create and update body{Resource}Patchwhen only used as the patch/update body@@clientNameoverrides on the patch-only pathBecause the rename is anchored to resource/role semantics rather than usage count, the breaking-change scenario described here (rename flipping when a model becomes referenced by additional operations in a new version) doesn't apply to MPG. I think this issue can be closed as not applicable to MPG.