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>;
}