arm-put-operation-response-codes
@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codesEnsure put operations have the appropriate status codes.
Put operations should use the ArmResourceCreateOrReplaceAsync or ArmResourceCreateOrReplaceSync template. They must have 200, 201, default and no other responses.
Impact
Section titled “Impact”- Area: API
The PUT operation returns response codes that violate the RPC contract.
LintDiff Equivalent
Section titled “LintDiff Equivalent”This rule corresponds to the LintDiff rule PutResponseCodes.
❌ Incorrect
Section titled “❌ Incorrect”@armResourceOperationsinterface Employees { @armResourceCreateOrUpdate(Employee) createOrUpdate(...ApiVersionParameter): { @statusCode _: 200; result: boolean; };}✅ Correct
Section titled “✅ Correct”@armResourceOperationsinterface Employees { createOrUpdate is ArmResourceCreateOrReplaceAsync<Employee>;}Suppression
Section titled “Suppression”Suppress only when required to match an existing API; otherwise use the standard createOrUpdate operation templates.