post-operation-response-codes
@azure-tools/typespec-azure-resource-manager/post-operation-response-codes
Synchronous
Section titled “Synchronous”Synchronous post operations should have one of the following combinations of responses - 200 and default, or 204 and default. They must have no other responses.
❌ Incorrect
Section titled “❌ Incorrect”@armResourceOperationsinterface Employees { @armResourceDelete(Employee) delete(...ApiVersionParameter): { @statusCode _: 200; result: boolean; };}
âś… Correct
Section titled “✅ Correct”@armResourceOperationsinterface Employees { delete is ArmResourceDeleteSync<Employee>;}
Asynchronous
Section titled “Asynchronous”Long-running (LRO) post operations should have 202 and default responses. The must also have a 200 response only if the final response is intended to have a schema. They must have no other responses. The 202 response must not have a response schema specified.
❌ Incorrect
Section titled “❌ Incorrect”@armResourceOperationsinterface Employees { delete is ArmResourceDeleteAsync<Employee>;}
âś… Correct
Section titled “✅ Correct”@armResourceOperationsinterface Employees { delete is ArmResourceDeleteWithoutOkAsync<Employee>;}