Paging support: byPage not exposing settings parameter
See original GitHub issueWhen generating an operation with paging, it mostly works well, except the byPage
method that is generated does not pass the settings parameter down as defined on the PagedAsyncIterableIterator
interface.
export interface PagedAsyncIterableIterator<T, PageT = T[], PageSettingsT = PageSettings> {
next(): Promise<IteratorResult<T, T>>;
[Symbol.asyncIterator](): PagedAsyncIterableIterator<T, PageT, PageSettingsT>;
byPage: (settings?: PageSettingsT) => AsyncIterableIterator<PageT>;
}
Generate code:
public listAvailableWorkers(
options?: RouterGetAvailableWorkersOptionalParams
): PagedAsyncIterableIterator<Worker> {
const iter = this.getAvailableWorkersPagingAll(options);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: () => {
return this.getAvailableWorkersPagingPage(options);
}
};
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:28 (17 by maintainers)
Top Results From Across the Web
Paginating Requests in APIs. | Medium - Ignacio Chiazzo
When exposing large data sets through APIs, it needs to provide a mechanism to paginate ... SQL query generated by page-based pagination.
Read more >Load and display paged data - Android Developers
The following example implements a PagingSource that loads pages of items by page number. The Key type is Int and the Value type...
Read more >How to configure Spring boot pagination starting from page 1 ...
Just make oneIndexed parameter equals to true in your configuration file and pagination will start ... spring.data.web.pageable.one-indexed-parameters=true.
Read more >Advanced Guide to Page View Tracking in Google Analytics 4
Learn how to properly track page view measurement in Google Analytics 4 (GA4). And get more insights through your page reporting.
Read more >class WP_Query {} - WordPress Developer Resources
Post & Page Parameters. Display content based on post and page parameters. Remember that default post_type is only set to display posts but...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Haha, I think when we migrated from the super old SDKs we just assumed methods named like
list
still returned promises. Thanks for pointing out where we can drop the someawait
s.Yes I think that would be clearer. Even more clearer would be if the comment put “value” and “byPage” in back-tics (`), and maybe even with a leading dot on “value”. So like:
Hi @MRayermannMSFT , The below is new sdk package azure-arm-resources-5.1.0.zip
We would like you help us verify whether the package works as your expected before release, you can also learn more by this pr: https://github.com/Azure/azure-sdk-for-js/pull/23688
Thanks.