-
Notifications
You must be signed in to change notification settings - Fork 82
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
how to use AsyncPage with a response type that is not a JSON array? #41
Comments
mattnworb
added a commit
that referenced
this issue
Oct 28, 2020
this change implements support for https://docs.github.com/en/free-pro-team@latest/rest/reference/apps#list-repositories-accessible-to-the-app-installation I believe though, that in this initial form, the response is limited to only the first page of results returned by the Github API: #41
henriquetruta
pushed a commit
that referenced
this issue
Oct 29, 2020
#42) * add method to list repos accessible to a Github App this change implements support for https://docs.github.com/en/free-pro-team@latest/rest/reference/apps#list-repositories-accessible-to-the-app-installation I believe though, that in this initial form, the response is limited to only the first page of results returned by the Github API: #41 * add GithubAppClientTest#listAccessibleRepositories and refactor other tests This commit refactors GithubAppClientTest so that it tests the actual methods in GithubAppClient and adds a test of the new method `listAccessibleRepositories()`. Previously the test did not actually test any logic in GithubAppClient but rather the tests were of the deserialization logic for some of the types used in the class. I moved the test related to deserializing an AccessToken to a new AccessTokenTest, and replaced the other tests so that they use a MockWebServer to actually be able to test the HTTP requests/responses. * minor: unnecessary type arguments * forgot to teardown MockWebServer use it as a Rule instead to make things a little simpler * squash: remove redundant toCompletableFuture() calls
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Some Github API responses will be paginated and return a JSON object like:
for example: https://docs.github.com/en/free-pro-team@latest/rest/reference/apps#list-repositories-accessible-to-the-app-installation
It seems like these cannot be represented as
GithubPage<T>
since the constructor requires aTypeReference<List<T>>
:github-java-client/src/main/java/com/spotify/github/v3/clients/GithubPage.java
Lines 60 to 61 in d00da14
which would mean that if I want to add a method to e.g. GithubAppClient to list the repos accessible to a Github app installation, I'd have to return just the single JSON response (as a Java type) - which would risk only being able to return as much data as the Github API fits into the initial page (which I think maxes out at 100 items).
... or maybe I am missing something?
The text was updated successfully, but these errors were encountered: