Skip to content

Support model flatten from two layers of extends in TypeSpec #5385

@HarveyLink

Description

@HarveyLink

Bug Description

The .NET code gen doesn't support model faltten with 2 layers of extends in TypeSpec.
Sample link: https://github.com/Azure/azure-rest-api-specs/blob/897f19441a4cc240eba138296f31e50841a6b57f/specification/edgeorder/resource-manager/Microsoft.EdgeOrder/EdgeOrder/models.tsp#L1648
e.g.

@@flattenProperty(ProductLine.properties);

model ProductLine {
  properties?: ProductLineProperties;
}
model ProductLineProperties extends CommonProperties {
  products?: Product[];
}
model CommonProperties extends BasicInformation {
  filterableProperties?: FilterableProperty[];
}
model BasicInformation {
  displayName?: string;
...
}

The properties from BasicInformation and CommonProperties will missing in the generated class.

Expected Behavior

All the properties from BasicInformation and CommonProperties models get generated in ProductLine class.

Actual Behavior

Only one property: products is generated.

Metadata

Metadata

Assignees

Labels

MgmtThis issue is related to a management-plane library.v3Version 3 of AutoRest C# generator.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions