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

Handle pagination for client code #39

Open
fredthomsen opened this issue Jan 11, 2022 · 2 comments
Open

Handle pagination for client code #39

fredthomsen opened this issue Jan 11, 2022 · 2 comments

Comments

@fredthomsen
Copy link

My thoughts on API client libraries are that pagination should be handled by them or at least have the option to be handled by them and the client code does not have to concern itself with calling functions again to deal with pagination etc. Now realizing this is auto-generated code is this something of interest? If so, I can put together something more concrete.

@potiuk
Copy link
Member

potiuk commented Jan 11, 2022

I think maybe that's somethign that can be added in the tool we use for generation of the clients ? I woudl have found it a bit problematic if we had to do some more manual modifications of the generated code, but maybe contributing such feature there might solve the ptoblem (for us and others). Or maybe it's already there and we do not use it?

@fredthomsen
Copy link
Author

After some digging around looks like there is a lot of debate around this feature, and understandably so given the different ways pagination can be handled across different APIs.

Some of the main issues I looked into for reference:

Looks like Transposit has created an OpenAPI extension to handle some of the most common types of pagination to address this issue: https://www.transposit.com/blog/2019.12.10-using-extensions-to-support-pagination-in-openapi/, but this implementation isn't open sourced. How it's done there is how I envisioned something like this working.

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

2 participants