[tcgc] Add a decorator for LRO operations to specify what type to return in client method
- Dominant language
- TypeScript
- Stars
- 27
- Forks
- 90
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 156
Description
**Feature request:**
Add a decorator to specify what response type to return for LROs.
**Context:**
Some services define LROs that return their status monitor schema as the final response of their LRO, this is acceptable behavior in some contexts. See this spec definition approved by the stewardship board: https://github.com/Azure/azure-rest-api-specs/blob/5046b2ea8ec0a7701990de74feee1d357114ca7a/specification/ai/HealthInsights/HealthInsights.RadiologyInsights/route.radiologyinsights.tsp#L25
However, in the sdks we usually try to return the type of the `result` property on the status monitor schema. If all languages align on returning the type of the `result` property as the default behavior, then we should allow service partners to choose if they want the top-level response envelope to be returned instead. A decorator could help with this. In the example above, the difference would be between returning `RadiologyInsightsJob` vs `RadiologyInsightsInferenceResult`.
cc @johanste
Contributor guide
Research direction
Start with the linked route.radiologyinsights.tsp example at the referenced L25 definition, then trace how LRO return types are currently selected in this repository. Define how a decorator would choose between the status-monitor envelope and its result type, and verify the behavior for both cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100