arm-no-record
@azure-tools/typespec-azure-resource-manager/arm-no-recordDon’t use Record types for ARM resources.
ARM requires Resource provider teams to define types explicitly. This is to ensure good customer experience in terms of the discoverability of concrete type definitions.
Impact
Section titled “Impact”- Area: API, SDK
Record<> (additionalProperties) types are difficult to use from both the API and generated SDKs.
LintDiff Equivalent
Section titled “LintDiff Equivalent”This rule corresponds to the LintDiff rule AvoidAdditionalProperties.
❌ Incorrect
Section titled “❌ Incorrect”model Address { address: Record<string>; city: string; state: string;}✅ Correct
Section titled “✅ Correct”model Address { street: string; city: string; state: string; country: string; postalCode: string;}❌ Incorrect
Section titled “❌ Incorrect”model Address is Record<string>;✅ Correct
Section titled “✅ Correct”model Address { street: string; city: string; state: string; country: string; postalCode: string;}❌ Incorrect
Section titled “❌ Incorrect”model Address extends Record<string> {}✅ Correct
Section titled “✅ Correct”model Address { street: string; city: string; state: string; country: string; postalCode: string;}Suppression
Section titled “Suppression”Suppress only when required to match an existing API; otherwise use a defined type.