Skip to content
This repository was archived by the owner on Jun 16, 2026. It is now read-only.
This repository was archived by the owner on Jun 16, 2026. It is now read-only.

[Feature] Fix the renamed parameter model name #3599

Closed

Description

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.

Activity

  1. added
    MgmtThis issue is related to a management-plane library.
    KoHThe goal of this project is to improve the codegen tool instead of customization code.
    on Jul 17, 2023
  2. removed
    KoHThe goal of this project is to improve the codegen tool instead of customization code.
    on Dec 26, 2024
  3. ArthurMa1978 commented on May 8, 2025

    @ArthurMa1978
    MemberAuthor

    This will move to MPG.

  4. haiyuazhang commented on May 14, 2026

    @haiyuazhang
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

MgmtThis issue is related to a management-plane library.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions