Skip to content
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

Unbranded CodeGen should generate paging operation with Azure Style #2992

Open
Tracked by #5204
lirenhe opened this issue Nov 27, 2024 · 3 comments
Open
Tracked by #5204

Unbranded CodeGen should generate paging operation with Azure Style #2992

lirenhe opened this issue Nov 27, 2024 · 3 comments
Assignees

Comments

@lirenhe
Copy link
Member

lirenhe commented Nov 27, 2024

TypeSpec already includes the support of Paging operation for unbranded: https://typespec.io/docs/standard-library/pagination/

Based on the current agreement, with @list, @pageItems and @nextLink, we could generate the paging operation similar with Azure style.
Please also ensure related models for paging are added into unbranded core.

@weidongxu-microsoft
Copy link
Member

weidongxu-microsoft commented Nov 29, 2024

A few options

  1. generate return model for each API as e.g. ListTodoItemPagedIterable which support stream and iterate (by item and by page).
    apparent downside is that it makes up a name, which also makes it susceptible to naming conflict.
  2. generate template e.g. PagedIterable<> which support stream and iterate (by item and by page), then API returns e.g. PagedIterable<TodoItem>
    it could be confusing if multiple such SDK is used together. but fine if only 1 SDK used.
  3. Have PagedIterable in clientcore

To me, seems (2) is fine.

@weidongxu-microsoft
Copy link
Member

initial design by Srikanta https://gist.github.com/srnagar/e9373153593920dcf1977c928c59e988

@weidongxu-microsoft
Copy link
Member

weidongxu-microsoft commented Dec 9, 2024

Schedule for pagination for e2e demo on Jan. :

  1. Ignore parameters on client-driven pagination for e2e demo, as they are not used in todoApp nor petStore.
  2. Decision about whether PagedIterable/PagedResponse models be in clientcore or generated <-- decision: models be in clientcore
  3. implement models in clientcore (about 3 weeks, majority of the clientcore effect be parallel from codegen effort)
  4. Implement the codegen part (about 2 weeks)

If it goes with the plan, we should be able to get (simple case of) pagination for unbranded in Jan.


Task breakdown

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

No branches or pull requests

3 participants