LongRunningOperationsOptionsValidator
December 14, 2022 ยท View on GitHub
Category
SDK Warning
Applies to
ARM and Data Plane OpenAPI(swagger) specs
Related ARM Guideline Code
- RPC-Async-V1-05
Output Message
A LRO Post operation with return schema must have "x-ms-long-running-operation-options" extension enabled.
Description
This is a rule introduced to make the understanding of Long Running Operations more clear.
In case of LRO Post operation with return schema, it MAY be ambiguous for the SDK to understand automatically what the return schema is modeling. To avoid any confusion that would lead SDK to incorrectly instantiate the return type, service team needs to explain if the return schema is modeling a result from a "Location" header, or from an "Azure-AsyncOperation" header.
More details on LRO operation could be found here
How to fix the violation
For a Post LRO operation, add "x-ms-long-running-operation-options" extension with "final-state-via" property.
"x-ms-long-running-operation-options": {
"final-state-via": "location"
}
or
"x-ms-long-running-operation-options": {
"final-state-via": "azure-async-operation"
}