-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeSpec C# emitter doesn't produce LRO GetOperationStatus API #3964
Comments
@devlie It's by design that operations referred by We actually don't use the operation specified in
So can you try to use other ways to define your LRO? Like https://azure.github.io/typespec-azure/docs/libraries/azure-core/reference/interfaces#Azure.Core.LongRunningResourceAction That doesn't require a |
Doesn't |
@devlie, aside compat, is there a reason why the users would need GetOperationStatus? The user can call Operation.UpdateStatus to get the current status, can't she/he? |
@KrzysztofCwalina There are cases that users preserve the operation ID, and later on invoke explicit One solution is the LRO rehydration (#2158) which is not available yet. |
@KrzysztofCwalina, sorry for the late response. It depends on what kind of LRO method DPG emits - if it only emits a blocking method (start LRO and wait till done), then exposing In theory, a service can show intermediate progress (e.g. % complete) in the Specifically for our service, the only intermediate progress we show is we expose the updateId of the update being imported in the middle of the operation (the importer doesn't know it because the update can be authored by a different party). If I were to handwrite our SDK, I would write both blocking and non-blocking LRO methods. |
After discussion, we decided to adopt the following strategy:
|
* feat(dpg): generate polling operation by default Polling operation can be both public and internal. If we by default do not generate polling operations, then there is no way for developers to generate public polling operations. We can use `@access` to hide polling operations, or define LRO in other ways so that polling operation will not be defined. - change emitter to emit polling operation by default - regen test/samples - add test case for lro polling operation in namespace without @service resolve #3964 --------- Co-authored-by: Mingzhe Huang (from Dev Box) <mingzhehuang@microsoft.com>
Describe the issue or request
We are converting our Swagger to TypeSpec, and we have 2 LRO APIs,
ImportDevices
andImportUpdate
that each has corresponding polling APIGetOperationStatus
.The API is present in old Swagger and the method was generated for our shipped SDK.
The API is ported to TypeSpec and the generated Swagger also has it, but it's not auto-generated by C# emitter.
When compiling, the backward compat checker flags them as missing:
Here's the link to generated code
The text was updated successfully, but these errors were encountered: