Skip to content

Conversation

@martinvanzijl
Copy link
Contributor

Description

Helps with #126. This adds the type and site_admin field from the API to GHPerson. It does not completely solve the issue, but at least you can use getType() to see whether the owner is actually a User or an Organization.

NOTE: I'm not sure I need the calls to populate(); it worked fine without them in my unit tests. How can I be sure?

@bitwiseman
Copy link
Member

@martinvanzijl
Short answer: I don't know but what you have done is a reasonable start.

Slightly longer answer: populate() is needed for when the User or Organization is created from a response that has only partial information - but I don't know which fields those are. 😭

Non-answer information: I started to add the Refreshable interface that will work without knowing which fields are missing from partial responses. However, it isn't applied generally yet and it is basically the same as populate() - which I'm not sure it is the right way to go long term (see #589 for some background).

@bitwiseman bitwiseman merged commit 8fd5ed5 into hub4j:master Dec 18, 2019
@martinvanzijl martinvanzijl deleted the issue_126_add_type_and_site_admin_fields branch December 18, 2019 03:16
PauloMigAlmeida added a commit to PauloMigAlmeida/github-api that referenced this pull request Dec 19, 2019
Signed-off-by: PauloMigAlmeida <paulo.miguel.almeida.rodenas@gmail.com>
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.

2 participants