Skip to content

[http-client-java] Support continuation-token paging in Azure V1 - #12196

Merged
Weidong Xu (weidongxu-microsoft) merged 7 commits into
microsoft:mainfrom
weidongxu-microsoft:feature/java-azure-continuation-token
Oct 16, 2026
Merged

Weidong Xu (weidongxu-microsoft) merged 7 commits into
microsoft:mainfrom
weidongxu-microsoft:feature/java-azure-continuation-token

Conversation

@weidongxu-microsoft

Copy link
Copy Markdown
Contributor

Summary

  • Enable Azure V1 continuation-token paging using the original proxy for each page.
  • Hide tokens from public method signatures and support resuming through paging APIs.
  • Cover query/header tokens, body/header responses, nested properties, and XML.

has_more handling is out of scope; pagination ends when the response token is absent.

Validation

  • 51 emitter tests, 20 Azure paging tests, and 11 ClientCore paging tests passed.
  • Java generator unit tests, build, formatting, lint, and type checks passed.
  • Sync-over-async and model-maximum-overload clients compiled and passed paging smoke tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4bbe3fb2-95f1-4311-8050-62ba7dba4860
@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 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

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

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

Support continuation-token pagination in Azure Java clients. Tokens are hidden from client method signatures; resume through the paging API:,> ,> java,> client.list().streamByPage(token);,>

@azure-sdk-automation

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

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

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

Copilot-Session: 4bbe3fb2-95f1-4311-8050-62ba7dba4860
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 4bbe3fb2-95f1-4311-8050-62ba7dba4860

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.

🟡 Changes recommended

Generated-code compilation failures and growing per-page callback chains remain unresolved.

3 open findings
What changed in this PR

Adds continuation-token paging to Azure V1 Java clients, integrating automatic page retrieval and resumption with existing paging APIs.

Changes:

  • Preserves token metadata and propagates response tokens into subsequent requests.
  • Hides tokens from public signatures and delegation calls.
  • Adds emitter, generator, and paging tests, including XML scenarios.
File Description
packages/​http-client-java/​generator/​http-client-generator-test/​src/​test/​java/​payload/​pageable/​PageableTests.java Tests traversal, resumption, options reuse, and XML.
packages/​http-client-java/​generator/​http-client-generator-test/​src/​main/​java/​payload/​pageable/​XmlPaginationClient.java Removes explicit token overload.
packages/​http-client-java/​generator/​http-client-generator-test/​src/​main/​java/​payload/​pageable/​XmlPaginationAsyncClient.java Removes explicit async token overload.
packages/​http-client-java/​generator/​http-client-generator-test/​src/​main/​java/​payload/​pageable/​ServerDrivenPaginationContinuationTokenClient.java Hides tokens in synchronous APIs.
packages/​http-client-java/​generator/​http-client-generator-test/​src/​main/​java/​payload/​pageable/​ServerDrivenPaginationContinuationTokenAsyncClient.java Hides tokens in asynchronous APIs.
packages/​http-client-java/​generator/​http-client-generator-test/​src/​main/​java/​payload/​pageable/​implementation/​XmlPaginationsImpl.java Implements XML token paging.
packages/​http-client-java/​generator/​http-client-generator-test/​src/​main/​java/​payload/​pageable/​implementation/​ServerDrivenPaginationContinuationTokensImpl.java Implements query/header token paging.
packages/​http-client-java/​generator/​http-client-generator-core/​src/​test/​java/​com/​microsoft/​typespec/​http/​client/​generator/​core/​template/​ContinuationTokenPagingTests.java Tests paging templates and delegation.
packages/​http-client-java/​generator/​http-client-generator-core/​src/​main/​java/​com/​microsoft/​typespec/​http/​client/​generator/​core/​template/​WrapperClientMethodTemplate.java Filters hidden parameters from wrappers.
packages/​http-client-java/​generator/​http-client-generator-core/​src/​main/​java/​com/​microsoft/​typespec/​http/​client/​generator/​core/​template/​ServiceSyncClientWrapAsyncClientTemplate.java Filters sync-over-async delegation arguments.
packages/​http-client-java/​generator/​http-client-generator-core/​src/​main/​java/​com/​microsoft/​typespec/​http/​client/​generator/​core/​template/​ConvenienceSyncMethodTemplate.java Filters convenience delegation arguments.
packages/​http-client-java/​generator/​http-client-generator-core/​src/​main/​java/​com/​microsoft/​typespec/​http/​client/​generator/​core/​template/​ConvenienceMethodTemplateBase.java Omits hidden protocol arguments.
packages/​http-client-java/​generator/​http-client-generator-core/​src/​main/​java/​com/​microsoft/​typespec/​http/​client/​generator/​core/​template/​ClientMethodTemplateBase.java Hides tokens in generated documentation.
packages/​http-client-java/​generator/​http-client-generator-core/​src/​main/​java/​com/​microsoft/​typespec/​http/​client/​generator/​core/​template/​ClientMethodTemplate.java Generates token extraction and page callbacks.
packages/​http-client-java/​emitter/​test/​fixtures/​continuation-token.tsp Defines token-placement test scenarios.
packages/​http-client-java/​emitter/​test/​code-model.test.ts Verifies metadata across client flavors.
packages/​http-client-java/​emitter/​src/​code-model-builder.ts Enables Azure V1 token metadata.
.github/​instructions/​http-client-java.instructions.md Documents README regeneration workflow.
.chronus/​changes/​http-client-java-azure-continuation-token.md Announces paging support and resumption.

🧠 Review effort: Balanced


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

Avoid token lambda name collisions and preserve typed token forwarding for Context-based clients.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4bbe3fb2-95f1-4311-8050-62ba7dba4860

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.

Prefer next-link metadata over continuation tokens, replace exact paging arguments, and allocate paging callback locals against enclosing parameters.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4bbe3fb2-95f1-4311-8050-62ba7dba4860
Copilot AI balanced review requested due to automatic review settings October 15, 2026 06:17

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.

🔵 Needs a closer look

Retained callback accumulation and shared-options concurrency limitations need human acceptance, and XML attribute-token handling remains unresolved.

1 open finding
3 resolved since last review

🧠 Review effort: Balanced

Preserve XML attribute and namespace metadata when extracting paging tokens, including attributes on root and nested elements.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4bbe3fb2-95f1-4311-8050-62ba7dba4860

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.

🔵 Needs a closer look

Shared RequestOptions and callback-lifetime tradeoffs require human acceptance, alongside correction of XML namespace matching.

1 open finding
1 resolved since last review

🧠 Review effort: Balanced

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4bbe3fb2-95f1-4311-8050-62ba7dba4860
Copilot AI balanced review requested due to automatic review settings October 15, 2026 08:39

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.

🔵 Needs a closer look

Acknowledged callback accumulation and shared RequestOptions concurrency limitations require explicit human risk acceptance.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

Merged via the queue into microsoft:main with commit 8383597 Oct 16, 2026
44 checks passed
@weidongxu-microsoft
Weidong Xu (weidongxu-microsoft) deleted the feature/java-azure-continuation-token branch October 16, 2026 02:40
Weidong Xu (weidongxu-microsoft) added a commit to Azure/typespec-azure that referenced this pull request Oct 16, 2026
…5745)

Update the Java core pin to `f098e0fdd` for the `0.48.2` hotfix. No
package version bump in this PR.

- Include continuation-token paging (microsoft/typespec#12196), enum
Javadoc escaping (microsoft/typespec#12177), and dependency
synchronization (microsoft/typespec#12286), plus upstream dependency
maintenance (microsoft/typespec#12205, microsoft/typespec#12207,
microsoft/typespec#12287).
- Sync upstream integration tests and add a local version-sync script
for shared test dependencies/plugins, using the pinned upstream POMs.
Preserve Azure-specific tooling and generated samples.
- Record all changes as Chronus `fix`, as requested for this release
branch.

Validation: branded emitter/generator build, offline version-sync tests,
enum/ARM generation smoke checks, repository formatting and lint.

Copilot-Session: c93fd771-4af9-4e61-b9af-8f2b15588c47
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 eng

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants