Skip to content

arm-custom-resource-no-key

Id
@azure-tools/typespec-azure-resource-manager/arm-custom-resource-no-key

Validate that custom resource contains a key property.

Without a key, operation paths may be duplicated.

  • Area: API, SDK

Mainly a correctness issue: the resource’s name property should be marked with @key.

@Azure.ResourceManager.Legacy.customAzureResource
model CustomResource {
someId: string;
}
@Azure.ResourceManager.Legacy.customAzureResource
model CustomResource {
@key
someId: string;
}

Suppress only when required to match an existing API; otherwise add @key to the name parameter of the resource.