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

Support https://api.github.com/user? #89

Closed
dpc opened this issue Oct 15, 2017 · 2 comments
Closed

Support https://api.github.com/user? #89

dpc opened this issue Oct 15, 2017 · 2 comments

Comments

@dpc
Copy link
Contributor

dpc commented Oct 15, 2017

I need to get information about the signed-in user, and I can't find a an API to do it. If I write a PR, will it be accepted?

It seems there are more information in the response to this endpoint, then User currently have. Should I create a new structure, or extend the existing one somehow? How should I name them?

@softprops
Copy link
Owner

Pulls are absolutely welcome. In looked at https://developer.github.com/v3/users/#get-the-authenticated-user and I can see the structure returned has some private info not available in the user structure returned in other apis.

The pattern is typically to define a new method associated with the github struct https://github.com/softprops/hubcaps/blob/master/src/lib.rs for an exported interface in another module.

This might look something like.

let user = github.users().authenticated().unwrap()

A users mod currently exists but lacks query interfaces https://github.com/softprops/hubcaps/blob/master/src/users/mod.rs but you can infer what one might look like based on the other mods.

As for type name maybe AuthenicatedUser?

Let me know if you get stuck.

@dpc
Copy link
Contributor Author

dpc commented Oct 15, 2017

Fixed in #90 and #91

@dpc dpc closed this as completed Oct 15, 2017
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

No branches or pull requests

2 participants