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

Expose has-more header to caller #2

Open
501st-alpha1 opened this issue Jan 14, 2021 · 2 comments
Open

Expose has-more header to caller #2

501st-alpha1 opened this issue Jan 14, 2021 · 2 comments
Assignees

Comments

@501st-alpha1
Copy link

Some endpoints, such as Get Cards by Board, return a has-more header which indicates whether the results are incomplete and there are more results on the next page. It doesn't look like this is currently returned to the caller, so it'd be useful to expose that.

Do you have any thoughts on the best way to do this? If you don't have time to actually implement it yourself, I can probably open a PR after we discuss this.


Thanks for making this library by the way! It has greatly sped up my ability to write scripts for the Glo Boards API.

@dpeite
Copy link
Owner

dpeite commented Jan 19, 2021

Hi, It's been a while since I wrote this code and I see that the api has some changes like new endpoints and the has-more header.

I'm a bit busy right now, but I'll try to get some time in the next days and look into the new changes.

I suppose that the way to do this is with a method that return if the last call to an endpoint has the header defined. But I'm open to new ideas or suggestions.

@dpeite dpeite self-assigned this Jan 19, 2021
@501st-alpha1
Copy link
Author

I suppose that the way to do this is with a method that return if the last call to an endpoint has the header defined. But I'm open to new ideas or suggestions.

Yes that should work. An alternative would be to return a custom object, with the current result as a member of that object. So instead of e.g. returning a list of Boards, it'd be something like:

ResultObject:
  has_more: True,
  data: <boards...>

The downside would be that this wouldn't be backwards-compatible, but this has the benefit of making each function call stateless, and it would probably make it easier to expand to returning other things if needed, such as the HTTP status code.

No rush on the changes either way. If you don't have time and would like me to attempt a PR, let me know.

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