Description
To keep the ability of expanding new properties, we could make the model that would be replaced by SubResource
or WriteableSubResource
inheriting them instead of replacing
Now we have "safe flatten" in mgmt plane which will automatically flatten the properties with a type of "single property" class. But this does not work when the property is a list of a "single property" class, for instance, a property
public IList<WritableSubResource> Subnets {get;}
here the WritableSubResource
here is not its actual type, it is replaced by the generator. When a new property is added to the element in swagger, the replacement will no longer apply therefore we will get a breaking change now.
If we could make the replacement in this way: we generator the class without replacing it, but let it inherit from SubResource
or WritableSubResource
, the SDK will end up in this way:
public IList<SubnetInfo> Subnets {get;}
public partial class SubnetInfo : WritableSubResource {}