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

Added support for the extended stargazers API in Github V3 API #272

Merged
merged 1 commit into from
Jun 3, 2016
Merged

Added support for the extended stargazers API in Github V3 API #272

merged 1 commit into from
Jun 3, 2016

Conversation

noctarius
Copy link
Contributor

Github has added starred_at date to stargazers when stargazers are requested with a special (new) version on the REST API. Added support for the version and a type representing the additional information.

@Override
public PagedIterator<GHStargazer> _iterator(int pageSize) {
Requester requester = root.retrieve();
requester.setHeader("Accept", "application/vnd.github.v3.star+json");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it continue working with previous APIs? E.g. on old GitHub Enterprise instances

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question - don't think so, good catch.
Maybe it should have both versions supported

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added back the old version for compatibility and also listExtendedStargazers to return the new version. In addition added Javadoc to link both methods :)

@kohsuke kohsuke merged commit 2508e02 into hub4j:master Jun 3, 2016
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

Successfully merging this pull request may close these issues.

3 participants