Skip to content

[Azure Mgmt Generator] Code in model factory is incorrect when we have both client flatten and safe flatten #52667

@ArcturusZhang

Description

@ArcturusZhang

When we have this:

model Foo {
// omit other properties
@flattenProperty
properties?: FooProperties;
}

model FooProperties {
profile?: SinglePropertyModel;

other?: string;
}

model SinglePropertyModel {
single?: string;
}

In this case, we first flatten the properties property, then flatten the singlePropertyModel.
The model factory of this model should have this signature:

public static Foo Foo(string profileSingle = default, string other = default)

The signature is correct, but the implementation is not properly "unflatten" the safe-flattened property back.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CodeGenIssues that relate to code generationMgmtThis issue is related to a management package.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions