-
Notifications
You must be signed in to change notification settings - Fork 5k
Adopt pageable spector scenarios #50260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 generated pageable patterns to support Spector’s next-link and continuation-token scenarios by passing explicit nextLink
URIs, unifying loop logic, and propagating cancellation tokens to the base Pageable
constructors.
- Constructors now call the base
Pageable
ctor with the cancellation token. - Paging methods switch from string-based continuation tokens to
Uri
next-link variables and reshape loops accordingly. - The code generator (
CollectionResultDefinition
) was refactored to better handle protocol vs. model-based paging, plus adjustments to launch settings and script exclusions.
Reviewed Changes
Copilot reviewed 54 out of 54 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
test/Providers/.../NextLinkTests/*.cs | Updated test stubs to use Uri nextLink and new loop patterns |
test/Providers/.../ListPageableTests/*.cs | Converted single-page loops to direct calls, removed do/while |
test/Providers/.../ContinuationTokenTests/*.cs | Switched to nextPage tokens, removed old continuationToken logic |
src/Providers/CollectionResultDefinition.cs | Refactored generator to insert nextLink , nullability, and loop building |
src/Properties/launchSettings.json | Added http-payload-pageable profile |
eng/scripts/Generate.ps1 | Removed failing payload/pageable spec from generation script |
Comments suppressed due to low confidence (1)
eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/CollectionResultDefinition.cs:45
- The
continuationToken
parameter should remain nullable to reflect that callers may passnull
. Use new CSharpType(typeof(string), isNullable: true) so the generated signature isstring? continuationToken
.
private static readonly ParameterProvider ContinuationTokenParameter = new("continuationToken", "A continuation token indicating where to resume paging.", new CSharpType(typeof(string)));
Fixes #48061