You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@dolauliHere is a playground showing how to accomplish this. The idea is that properly-decorated headers need to be specified in the 202 response, and in cases where there are multiple ways to resolve the lro (for example, Azure-AsyncOperation and location header), you can use the @useFinalStateVia decorator to prefer one header over the other in the output.
The problem I ran into is that there's a bug in the API - getLroMetadata provided in the typespec-azure-core library. Even though azure-async-operation is specified for LRO in the TypeSpec files (as shown in the two examples I provided in the issue description), the API incorrectly returns location for finalStateVia instead of azure-async-operation.
tsp api set pollingLocation on Operation-Location but when we fetch its final-state-via through getLroMetadata(program, op).finalStateVia, we will get original-uri instead. Please have a check about this part.
You can reproduce it by checking this playground and x-ms-long-running-operation-options for @azure-tools/typespec-autorest emitter.
Describe the bug
Below are two cases: one for LRO update and the other for LRO deletion
https://github.com/Azure/azure-rest-api-specs/blob/fa6c6015b1633a701edb629c1a759433aa1fdaf2/specification/scvmm/ScVmm.Management/VmmServer.tsp#L44-L48
https://github.com/Azure/azure-rest-api-specs/blob/fa6c6015b1633a701edb629c1a759433aa1fdaf2/specification/scvmm/ScVmm.Management/VmmServer.tsp#L54-L59
When I attempt to use the following code to retrieve finalStateVia
Expected value of finalStateVia:
azure-async-operation
Actual value:
location
Reproduction
Added in the description
Checklist
The text was updated successfully, but these errors were encountered: