GitHub.jl
GitHub.jl copied to clipboard
Revamp suggestions
trafficstars
Having tried using this package, here are a grab bag of suggestions for how it might be improved:
- [ ] get rid of
Dicts where possible, e.g. by parsing JSON directly to relevant objects (e.g. using JSON2/JSON3) - [ ] have pagination be handled as a lazy iterator
- [ ] move interface away from shallow wrapper over requests
- positional arguments should be true options (e.g. as options to GET requests)
- when passing objects (for POST/PATCH reqs), should be positional argument
- for PATCH reqs, many APIs pass an id as a path, and the rest of the object as a parameter: these could be combined on the Julia side, e.g.
edit_issue(repo, issue; param=issue)could just beedit_issue(repo, issue).
- for PATCH reqs, many APIs pass an id as a path, and the rest of the object as a parameter: these could be combined on the Julia side, e.g.
- move auth (and possibly headers) into GitHubAPI object, since a common auth will typically be used by all requests
- [ ] create mock tests, using either
- using JSON samples from the GitHub API docs
- replay HTTP requests (e.g. this is what PyGitHub uses): https://github.com/PyGithub/PyGithub/tree/master/tests/ReplayData
Thoughts?