-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Description
Description
When a TypeSpec model inherits properties from a base model (via \�aseModel), the provisioning generator only emits the model's own properties, dropping all inherited ones.
For example, \SecretAttributes\ inherits 5 properties (\Created, \Enabled, \Expires, \NotBefore, \Updated) from \SecretBaseAttributes, but the generated class has none of them.
Root Cause
Two issues:
-
\ProvisioningModelProvider.BuildProperties()\ only iterates _inputModel.Properties, which contains only the model's own properties — not those inherited from \�aseModel.
-
\InheritableSystemObjectModelVisitor\ (inherited from mgmt generator) strips properties matching the base model's properties. This is correct for mgmt (where C# inheritance mirrors TypeSpec), but wrong for provisioning (where all models use \ProvisionableConstruct\ as C# base).
Fix
- Walk the \�aseModel\ chain to collect all inherited properties.
- Remove \InheritableSystemObjectModelVisitor\ from provisioning generator since provisioning models don't use C# model inheritance.
Impact
Any provisioning model that inherits properties from a base model will be missing those properties.