Add support for pageable LROs
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- rust, typescript
- Domain
- build-system, tooling
Research direction
Start with the existing lropaging skip in src/tcgcadapter/adapter.ts and compare the LRO and pageable implementations in src/codemodel/client.ts, src/codemodel/types.ts, and src/codegen/clients.ts. Review the azure_core Poller and Pager API shape, then create a minimal test under test/tsp/. Done means generated pageable LRO methods compile and the listed Microsoft.Web operations pass the build, test, tspcompile, cargo build, and clippy checks.
Written by the indexing model from the issue text.
Description
Summary
Add support for pageable LROs — operations that are both long-running AND return paginated results. These are rare in ARM but exist in at least three services. In the TCGC SDK, these surface as methods with kind: 'lropaging'.
Current State
The emitter explicitly skips lropaging methods with a warning (see src/tcgcadapter/adapter.ts lines 1369-1378):
if (method.kind === 'lropaging') {
// skip Paging LROs for now so that codegen is unblocked
// TODO: https://github.com/Azure/typespec-rust/issues/188
...
continue;
}
Issue #188 (LRO support) has been completed and closed, but the pageable LRO skip was left in place. The emitter already has full support for both pageable methods (returning Pager<T>) and lro methods (returning Poller<T>) independently — this feature combines them.
Affected Services
Grepping through the Go ARM SDKs, the following contain pageable LROs:
1. armappservice (Microsoft.Web)
EnvironmentsClient.BeginChangeVnet— Move an App Service Environment to a different VNET. ReturnsPoller[Pager[ChangeVnetResponse]].EnvironmentsClient.BeginResume— Resume an App Service Environment. ReturnsPoller[Pager[ResumeResponse]].EnvironmentsClient.BeginSuspend— Suspend an App Service Environment. ReturnsPoller[Pager[SuspendResponse]].- TypeSpec:
specification/web/resource-manager/Microsoft.Web/AppService/AppServiceEnvironmentResource.tsp - The
changeVnet,resume, andsuspendoperations useDiagnosticsOpsrouted operations with LRO + list semantics.
2. armnetwork (Microsoft.Network)
- Various operations that are long-running and return paginated lists of resources (exact operations to be confirmed from TypeSpec specs).
- TypeSpec:
specification/network/resource-manager/Microsoft.Network/
3. armorbital (Microsoft.Orbital)
- Similar pattern to network — pageable LRO operations.
- TypeSpec:
specification/orbital/resource-manager/Microsoft.Orbital/
Rust API Design
In the Go SDK, pageable LROs are typed as *runtime.Poller[*runtime.Pager[T]]. The Rust equivalent should follow a similar composition:
// Option A: Nested generic — Poller wraps Pager
pub async fn begin_change_vnet(&self, ...) -> Result<Poller<Pager<WebAppCollection>>>
// Option B: Dedicated PageablePoller type
pub async fn begin_change_vnet(&self, ...) -> Result<PageablePoller<WebAppCollection>>
The polling phase completes the LRO. Once the LRO completes, the result is iterable as pages via the inner Pager. The exact API shape should be consistent with the azure_core Rust crate's Poller and Pager types.
Implementation Plan
Phase 1: Code Model
-
Add
LroPagingMethodtosrc/codemodel/client.ts- New interface combining
LroMethodandPageableMethodproperties:kind: 'lropaging'- LRO fields:
finalResultStrategy,statusMonitor - Pageable fields:
pageableItemName,nextLink,continuationToken
- Add corresponding class implementation
- New interface combining
-
Add
LroPagingreturn type tosrc/codemodel/types.ts- Compose
Poller<Pager<T>>return type
- Compose
Phase 2: Adapter
- Handle
lropaginginsrc/tcgcadapter/adapter.ts(lines 1369-1378)- Replace the skip/warning with actual adaptation logic
- Extract both LRO metadata (final result strategy, status monitor) and paging metadata (nextLink, page item name)
- Create
LroPagingMethodinstances
Phase 3: Code Generation
- Generate pageable LRO method bodies in
src/codegen/clients.ts- Combine the polling closure logic (from
getLroMethodBody()) with the paging handler logic (fromgetPageableMethodBody()) - The LRO poller should resolve to a
Pagerthat handles pagination of the final result
- Combine the polling closure logic (from
Phase 4: Testing
-
Create a minimal TypeSpec test under
test/tsp/- Define a simple pageable LRO operation for unit testing
- Verify the generated Rust code compiles
-
Verify against real ARM specs
- Test code generation against the
Microsoft.Web/AppServiceTypeSpec specs - Ensure the generated
BeginChangeVnet,BeginResume,BeginSuspendmethods compile and have the correct signatures
- Test code generation against the
Phase 5: Validation
- Full CI validation
pnpm build— emitter compilespnpm test— unit tests passpnpm run tspcompile— regenerate test cratescargo build— generated Rust crates compilecargo clippy— no warnings
Dependencies
- LRO support (issue #188) ✅ completed
- Pageable support ✅ completed
- May depend on
azure_coreRust crate updates ifPoller<Pager<T>>composition isn't already supported
- Dominant language
- Rust
- Stars
- 7
- Forks
- 11
- Avg merge
- 14h 15m
- Merged PRs (30d)
- 6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure/typespec-rust
-
CodeGen rust
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Azure/typespec-rust#959 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 64/100
Azure/typespec-rust#1032 ·
-
CodeGen
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Azure/typespec-rust#1029 ·
-
CodeGen
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Azure/typespec-rust#1028 ·
-
CodeGen
Difficulty 3/5 1-2 days Newbie friendliness 55/100
Azure/typespec-rust#1020 ·
All issues in Azure/typespec-rust
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug team:backend track:services-maintenance
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
cowprotocol/services#4950 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·