Skip to content

arm-resource-patch

Id
@azure-tools/typespec-azure-resource-manager/arm-resource-patch

Validate ARM PATCH operations.

The request body of a PATCH must be a model with a subset of the resource properties. The PATCH body must not contain properties that do not exist on the resource.

  • Area: API

Inconsistent PATCH properties violate the RPC contract.

This rule corresponds to the LintDiff rule ConsistentPatchProperties.

model FooResource is TrackedResource<FooProperties> {
...ResourceNameParameter<FooResource>;
}
model MyBadPatch {
name?: string;
...Foundations.ArmTagsProperty;
blah?: string; // does not exist on FooResource
}
model FooResource is TrackedResource<FooProperties> {
...ResourceNameParameter<FooResource>;
}
model FooPatch {
name?: string;
...Foundations.ArmTagsProperty;
properties?: FooProperties;
}

Suppress per the RPC guidelines; otherwise use the standard PATCH operations.