mirage / ocaml-github

GitHub APIv3 OCaml bindings
ISC License
100 stars 61 forks source link

Fix the Event.for_repo_issues call. #134

Closed yallop closed 7 years ago

yallop commented 8 years ago

Before:

# Lwt_main.run (Github.Monad.run (Github.Stream.to_list (Github.Event.for_repo_issues ~user:"dsheets" ~repo:"ISO8601.ml"  ())));;
Bad response: Ag_oj_run.Error("Line 1:\nMissing record fields public, payload, repo, 0jic_type")
Exception:
Failure
 "Bad response: Ag_oj_run.Error(\"Line 1:\\nMissing record fields public, payload, repo, 0jic_type\")\n".

After:

# Lwt_main.run (Github.Monad.run (Github.Stream.to_list (Github.Event.for_repo_issues ~user:"dsheets" ~repo:"ISO8601.ml"  ())));;
- : Github_t.issues_event list =
[{Github_t.issues_event_event = `Referenced;
  issues_event_issue =
   {Github_t.issue_url =
     "https://api.github.com/repos/dsheets/ISO8601.ml/issues/1";
    issue_html_url = "https://github.com/dsheets/ISO8601.ml/pull/1";
    issue_number = 1; issue_state = `Closed;
    issue_title = "Add unix dependency to the META file.";
    issue_body =
[...]
dsheets commented 8 years ago

See #107 but I think we need to support both the original flavor and the issue event specific variety. 😕

yallop commented 8 years ago

I've pushed an update that leaves the types used in jar/ as they were.

yallop commented 8 years ago

I've added another function to the interface, Event.for_repo_issue, which retrieves the events for a single issue (f67cb0f).

The types are very slightly different to Event.for_repo_issues, unfortunately.

dsheets commented 7 years ago

Rebase merged in #150.