Skip to content

Clarify Java pageable maxPageSize guidance for TypeSpec samples - #50434

Draft
Jianing Wang (MSFT) (jianingwang123) with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-max-page-size-samples
Draft

Jianing Wang (MSFT) (jianingwang123) with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-max-page-size-samples

Conversation

Copilot AI commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

TypeSpec Java guidance did not explain that pageable page sizing belongs on the returned pageable result, causing generated samples/tests to pass maxPageSize directly to client methods and fail compilation.

  • Documentation

    • Added explicit guidance in the TypeSpec Java quickstart Samples section.
    • Clarified that Java pageable convenience methods do not accept maxPageSize directly.
    • Directed sample/test authors to use PagedIterable / PagedFlux page iteration APIs instead.
  • Correct usage

    client.listItems()
        .iterableByPage(10)
        .forEach(page -> page.getElements().forEach(System.out::println));
    asyncClient.listItems()
        .byPage(10)
        .subscribe(page -> page.getElements().forEach(System.out::println));

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
36 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Co-authored-by: jianingwang123 <141212663+jianingwang123@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix maxPageSize usage in TypeSpec Java generated samples Clarify Java pageable maxPageSize guidance for TypeSpec samples Sep 14, 2026
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.

Use matrix instead of templates for vmImage parallelism

2 participants