Allow paging to be optionally disabled #192
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The main change here is to support making the auto paging behaviour optional. The reasoning behind this is that we don't know in advance how many pages of data there might be, and sometimes we only care about a small subset of the data.
I also fixed a couple other issues that I spotted while looking at this. Full details here:
DisableAutoPaging
. This defaults to false for backwards compatibility, but allows the behaviour of automatically requesting all pages of a paged response to be disabled.execute()
method into two versions - one that supports paging and another that doesn't. The reason I did this is that the previous version was adding thepagelen
parameter for any paths containing/repositories/
, but this breaks if you callRepositories.ListForAccount()
with a role specified, in which case there's no trailing/
. I figured it was better to be explicit about when to support paging or not.max_depth
support out of the client and intoRepository.ListFiles()
, which is where it's actually supported. I noticed thatRepository.ListBranches()
also specifies the max depth. It doesn't look like this is actually supported by the API to me, but I didn't want to risk breaking it in case I'm wrong.GetCommitContents()
where it was using aDELETE
instead of aGET
.