Context
spec
Keyvault has something like https://github.com/Azure/azure-rest-api-specs/blob/ca3e917fb791170fca9ffc11f5f2a7bb19783053/specification/keyvault/KeyVault.Management/Vault.tsp#L17
modelVaultextendsAzure.ResourceManager.Legacy.TrackedResourceWithOptionalLocation<
VaultProperties,
false
> {
}
modelTrackedResourceWithOptionalLocation<
Propertiesextends {},
PropertiesOptionalextendsvalueofboolean = true
> extendsResource {
properties?:Properties;
tags?:Record<string>;
location?:string;
}
modelResource {
id:string,
name:string,
type:string
}Issue
template model TrackedResourceWithOptionalLocation's additional properties(e.g. tags, location) will be populated into Vault.
Our current logic won't check Vault for additional resource properties. Vault will extend ProxyResource instead of Resource, since parent class doesn't have tags, location.
How do we specify that Vault should extend Resource instead of ProxyResource?
Proposals
- Check leaf class for resource properties as well. This will only involve at most two levels(root, leaf).
- Customization, enable customization-class in mgmt.
- Additional JavaSettings to specify the base resource, e.g.
base-resource:
Vault: ResourceManagedHsm: Resource
Prefer 1. Though for 1, another potential logic optimization will affect it -> we should also consider resource property's optionality/visibility.
For this, maybe an additional JavaSettings, e.g. resource-property-match-name-only: true(by default false) to help.
We may need another way to replace ProxyResource with Resource for servicebus case:
https://github.com/chunyu3/azure-rest-api-specs/blob/bd5305d1b18e78d4b0294cb75996b6663e792619/specification/servicebus/ServiceBus.Management/SBAuthorizationRule.tsp#L20
Context
spec
Keyvault has something like https://github.com/Azure/azure-rest-api-specs/blob/ca3e917fb791170fca9ffc11f5f2a7bb19783053/specification/keyvault/KeyVault.Management/Vault.tsp#L17
Issue
template model
TrackedResourceWithOptionalLocation's additional properties(e.g.tags,location) will be populated intoVault.Our current logic won't check
Vaultfor additional resource properties. Vault will extendProxyResourceinstead ofResource, since parent class doesn't havetags,location.How do we specify that
Vaultshould extendResourceinstead ofProxyResource?Proposals
Prefer 1. Though for 1, another potential logic optimization will affect it -> we should also consider resource property's optionality/visibility.
For this, maybe an additional JavaSettings, e.g.
resource-property-match-name-only: true(by defaultfalse) to help.We may need another way to replace
ProxyResourcewithResourceforservicebuscase:https://github.com/chunyu3/azure-rest-api-specs/blob/bd5305d1b18e78d4b0294cb75996b6663e792619/specification/servicebus/ServiceBus.Management/SBAuthorizationRule.tsp#L20