Skip to content

Implement PagedAsyncIterableIterator for paginated list operations #30

Description

@daviburg

Context

All list operations in the Node SDK return Promise<TListResult> directly (e.g., Promise<SubscriptionListResult>). The .NET SDK returns AsyncPageable<T> via ConnectorClientBase.CreatePageable<TPage, TItem>(), which automatically follows nextLink URLs across pages and yields items as an async enumerable.

Currently the Node SDK has no pagination at all — callers receive the first page and must manually implement nextLink following.

Parity gap

Aspect .NET SDK Node SDK
Return type for lists AsyncPageable<T> (lazy, follows nextLink) Promise<TListResult> (first page only)
Caller experience await foreach (var item in client.ListAsync()) Manual nextLink loop
nextLink validation SSRF-protected in ResolveUrl() N/A (not implemented)
Azure SDK guideline AsyncPageable<T> / IPageable<T> PagedAsyncIterableIterator<T> required

Proposed change

List operations should return PagedAsyncIterableIterator<T> from @azure/core-paging:

import { PagedAsyncIterableIterator } from "@azure/core-paging";

// e.g., in ArmClient
public listSubscriptions(options?: ListSubscriptionsOptions): PagedAsyncIterableIterator<Subscription>

This requires:

  1. Generator changes in CodefulSdkGenerator to emit PagedAsyncIterableIterator return types
  2. Adding @azure/core-paging as a dependency
  3. Implementing nextLink following in ConnectorClientBase with SSRF protection (see companion SSRF issue)

This is a breaking change to all list method signatures and return types.

Azure SDK guideline

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions