mirror of
https://github.com/jlengrand/github-api.git
synced 2026-04-05 08:21:21 +00:00
GHOrganization.createRepository broke, so I fixed that by using V3 API.
That didn't quite work because v3 API has owner as an object, whereas v2 API has owner as string. So then I fixed all the other retrieval points for GHRepository to use v3.
This commit is contained in:
@@ -23,7 +23,7 @@ public abstract class GHPerson {
|
||||
public synchronized Map<String,GHRepository> getRepositories() throws IOException {
|
||||
Map<String,GHRepository> repositories = new TreeMap<String, GHRepository>();
|
||||
for (int i=1; ; i++) {
|
||||
Map<String, GHRepository> map = root.retrieve("/repos/show/" + login + "?page=" + i, JsonRepositories.class).wrap(root);
|
||||
Map<String, GHRepository> map = root.retrieve3("/user/" + login + "/repos?per_page=100&page=" + i, JsonRepositories.class).wrap(root);
|
||||
repositories.putAll(map);
|
||||
if (map.isEmpty()) break;
|
||||
}
|
||||
@@ -32,7 +32,7 @@ public abstract class GHPerson {
|
||||
}
|
||||
|
||||
public GHRepository getRepository(String name) throws IOException {
|
||||
return root.retrieve("/repos/show/" + login + '/' + name, JsonRepository.class).wrap(root);
|
||||
return root.retrieve3("/repos/" + login + '/' + name, GHRepository.class).wrap(root);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user