github-api
github-api copied to clipboard
GHInvitation getId always returns 0
Describe the bug GHInvitation getId returns 'id' from GHObject, which defaults to 0. However, the correct invitation id is available in the private 'id' field on GHInvitation.
To Reproduce
- Create a GitHub repository
- Add a collaborator (an invitation will be sent)
- Run below code:
ghRepository.listInvitations().forEach(invitation -> System.out.println(invitation.getId()));
- 0 is printed for each invitation, rather than the invitation id.
Expected behavior The correct invitation id is printed, instead of 0.
Additional context I would like to be able to delete a GitHub invitation as an account owner of a repository. GitHub's API has this endpoint to delete an invitation manually, but the invitation id is required.
@bitwiseman I'd be happy to contribute a solution to this. Would you be able to invite me to hub4j-test-org organization please?