long-running-polling-operation-required
@azure-tools/typespec-azure-core/long-running-polling-operation-requiredLong-running operations that return an Operation-Location header should have a linked polling operation. Use the @pollingOperation decorator to link a status polling operation.
โ Incorrect
Section titled โโ IncorrectโOperation returning Operation-Location header without a linked polling operation:
op read(): Foundations.LongRunningStatusLocation;Custom header with Operation-Location without a polling operation:
op readWithCustomHeader(): { @header("Operation-Location") location: string;};โ Correct
Section titled โโ CorrectโUse the @pollingOperation decorator to link a status polling operation:
op getOperationStatus is Foundations.GetOperationStatus;
@pollingOperation(getOperationStatus)op read(): Foundations.LongRunningStatusLocation;op getOperationStatus is Foundations.GetOperationStatus;
@pollingOperation(getOperationStatus)op readWithCustomHeader(): { @header("Operation-Location") location: string;};