Skip to content

arm-no-record

Id
@azure-tools/typespec-azure-resource-manager/arm-no-record

Don’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.

  • Area: API, SDK

Record<> (additionalProperties) types are difficult to use from both the API and generated SDKs.

This rule corresponds to the LintDiff rule AvoidAdditionalProperties.

model Address {
address: Record<string>;
city: string;
state: string;
}
model Address {
street: string;
city: string;
state: string;
country: string;
postalCode: string;
}
model Address is Record<string>;
model Address {
street: string;
city: string;
state: string;
country: string;
postalCode: string;
}
model Address extends Record<string> {}
model Address {
street: string;
city: string;
state: string;
country: string;
postalCode: string;
}

Suppress only when required to match an existing API; otherwise use a defined type.