Skip to main content
Version: Latest (Core: 0.57.x, Azure: 0.43.x)

put-operation-response-codes

@azure-tools/typespec-azure-resource-manager/put-operation-response-codes

Put operations should use the ArmResourceCreateOrReplaceAsync or ArmResourceCreateOrReplaceSync template. They must have 200, 201, default and no other responses.

❌ Incorrect

@armResourceOperations
interface Employees {
@armResourceCreateOrUpdate(Employee)
createOrUpdate(...ApiVersionParameter): {
@statusCode _: 200;
result: boolean;
};
}

✅ Correct

@armResourceOperations
interface Employees {
createOrUpdate is ArmResourceCreateOrReplaceAsync<Employee>;
}