-
Notifications
You must be signed in to change notification settings - Fork 26
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
Use of the Max parameter #3
Comments
Thanks for opening this Darren. Let me work on it in the next few days. |
Darren, Sorry about the delay and thanks for bringing this back to my attention. I think there are two ways of doing this:
I’m not really sure what option do I like the most. I believe max should be respected because it’s the way to control how many resources you want the API to return at once. What I’m undecided is about developer experience. If handling the control to the developer of asking for more pages or an extra option to limit to an X amount of results. For example, max = 5 but 15 results. What do you think? |
I think if you had a max parameter and then just returned that many results, even if it required you to make multiple requests? |
How would you manage page_size in that case? |
Hmm good question. Either you don’t, and just return as many as they ask for or you implement it separately? Alternatively I guess you could allow the developer to manage it and just pass it through as you say. |
Ok, let me think about it a bit more during the weekend to see what I come up with. |
@darrenparkinson I included a paginate = true or paginate = false option. You can use the combination of max and paginate to limit how many items per request and if you want to paginate to obtain more items. |
Hi Jose,
I think we spoke about this some time ago and I wondered if you'd managed to look into it any further. I thought I'd log it as an issue to continue the conversation.
Essentially the question was regarding the
max
parameter.When using the SDK and specifying a Max of 5, it actually returns all items. You mentioned that you believed that was to do with the paging I think. The webex docs say the following:
And I think you took this to mean that when you specify the max parameter, you are just saying how many you want per page, and you are then returning all pages?
The docs go on to say:
So I was wondering if you might just return the single page containing the max requested along with the
rel="next"
header using the RFC5988 standard Cisco mentions:From memory, you were going to take a look at the python library to see how they handled it. And I think we discussed whether you would just pass the max parameter through or if you would abstract that away to enable an SDK user to specify a larger max size than the teams API and then use the paging internally to return the number the user requested (like the sparky sdk).
Ultimately though, what I'd like to achieve is that when I specify a max of 5, that only 5 results are returned?
Let me know what you think the best way to proceed is.
Speak soon. Thanks again,
D.
The text was updated successfully, but these errors were encountered: