GitHub.jl icon indicating copy to clipboard operation
GitHub.jl copied to clipboard

Revamp suggestions

Open simonbyrne opened this issue 6 years ago • 0 comments
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 be edit_issue(repo, issue).
    • 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?

simonbyrne avatar Oct 30 '19 17:10 simonbyrne