Skip to content

Update codegen for breaking changes in pageable methods#758

Merged
jhendrixMSFT merged 3 commits intomainfrom
paging-updates
Dec 11, 2025
Merged

Update codegen for breaking changes in pageable methods#758
jhendrixMSFT merged 3 commits intomainfrom
paging-updates

Conversation

@jhendrixMSFT
Copy link
Copy Markdown
Member

Updated code model to have discrete types for ClientMethodOptions, PagerOptions, and PollerOptions from azure_core.
The constructor for Pager now requires a PagerContinuationKind argument that's used to determine the emitted generic type parameters.

Updated code model to have discrete types for ClientMethodOptions,
PagerOptions, and PollerOptions from azure_core.
The constructor for Pager now requires a PagerContinuationKind argument
that's used to determine the emitted generic type parameters.
Copilot AI review requested due to automatic review settings December 11, 2025 20:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the code generation for pageable methods to support breaking changes in the azure_core library. The changes introduce discrete types for method options and update the Pager API to use a constructor that requires a continuation kind parameter.

Key Changes:

  • Introduced discrete types (ClientMethodOptions, PagerOptions, PollerOptions) to replace generic ExternalType usage
  • Updated Pager to include continuation kind as a generic type parameter when using continuation tokens
  • Replaced Pager::from_callback with Pager::new and wrapped async callbacks in Box::pin

Reviewed changes

Copilot reviewed 8 out of 29 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/typespec-rust/src/codemodel/types.ts Added new type definitions for ClientMethodOptions, PagerOptions, PollerOptions with PagerContinuationKind support
packages/typespec-rust/src/tcgcadapter/adapter.ts Updated method options creation to use new discrete types and set continuation kind for token-based paging
packages/typespec-rust/src/codegen/helpers.ts Updated type declaration generation to emit correct generic parameters for Pager and PagerOptions based on continuation kind
packages/typespec-rust/src/codegen/clients.ts Updated pageable method body generation to use Pager::new and Box::pin(async move)
packages/typespec-rust/src/codegen/use.ts Added logic to import format types when using continuation token strategy
packages/typespec-rust/test/**/*.rs Updated all generated test files with new Pager signatures and PagerOptions type parameters
packages/typespec-rust/test/Cargo.toml Updated azure_core dependency to compatible version
packages/typespec-rust/package.json Bumped version to 0.32.0
packages/typespec-rust/CHANGELOG.md Documented breaking changes

Comment thread packages/typespec-rust/test/Cargo.toml Outdated
Comment thread packages/typespec-rust/src/codegen/clients.ts
@jhendrixMSFT jhendrixMSFT merged commit cb329da into main Dec 11, 2025
4 checks passed
@jhendrixMSFT jhendrixMSFT deleted the paging-updates branch December 11, 2025 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants