Skip to content

[http-client-java] Preserve page-size overrides in typed async paging - #12163

Open
Xiaofei Cao (XiaofeiCao) wants to merge 5 commits into
microsoft:mainfrom
XiaofeiCao:xiaofeicao-issue-investigation
Open

Xiaofei Cao (XiaofeiCao) wants to merge 5 commits into
microsoft:mainfrom
XiaofeiCao:xiaofeicao-issue-investigation

Conversation

@XiaofeiCao

Copy link
Copy Markdown
Member

Fixes #12149.

Summary

  • Forward page-size overrides from typed asynchronous paging methods to the protocol PagedFlux, including continuation requests, while preserving default paging when no size is specified.
  • Regenerate the existing pageable async client with the corrected adapter.
  • Extend the existing PageableTests with async Spector coverage using byPage(3), verifying page sizes [3, 1] and users user5 through user8. No new test classes or mock API scenarios are included.

Validation

  • Red: the original generated adapter fails against Spector with HTTP 400: Expected query param maxpagesize=3 but got undefined.
  • Green: both synchronous and asynchronous PageableTests pass against the existing Spector mock API after a clean compilation.
  • Maven Java Spotless checks pass.
mvn clean test spotless:check --no-transfer-progress --define test=azure.payload.pageable.PageableTests

Fixes microsoft#12149

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service Bot added the emitter:client:java Issue for the Java client emitter: @typespec/http-client-java label Oct 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • ✅ @typespec/http-client-java
Show changes

@typespec/http-client-java - fix ✏️

Forward page-size overrides from typed asynchronous paging methods to protocol requests.

@azure-sdk-automation

azure-sdk-automation Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The implementation covers initial and continuation requests, preserves default behavior, and includes targeted regression coverage.

0 open findings

What changed in this PR

Fixes typed async paging so byPage(size) forwards page-size overrides through initial and continuation requests.

Changes:

  • Updates the async convenience-method generator.
  • Regenerates the pageable async client.
  • Adds Spector regression coverage and a fix changelog.
File Description
ConvenienceAsyncMethodTemplate.java Forwards optional page size in generated adapters.
PageableAsyncClient.java Regenerates the corrected client.
PageableTests.java Verifies async page sizes and returned users.
.chronus/​changes/​http-client-java-async-page-size.md Records the bug fix.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The template handles both sized and default paging paths, and the regression test covers continuation behavior.

0 open findings

🧠 Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:java Issue for the Java client emitter: @typespec/http-client-java

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Java typed async paging methods discard byPage page-size overrides

3 participants