mirage / ocaml-github

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

label field missing in branch refs for ghost #254

Closed dra27 closed 3 years ago

dra27 commented 3 years ago

The label field can be null. For compatibility, I've defaulted that to "" rather than changing the type.

Apparently null is used with the ghost user:

let open Github_t in
let pull =
  Lwt_main.run (Github.(Monad.(run (Pull.get ~user:"ocaml" ~repo:"ocaml" ~num:601 () >|= Response.value))))
in
  Printf.printf "PR %d: %s\n" pull.pull_number pull.pull_title
avsm commented 3 years ago

there is a different fix in #253 from @tmcgilchrist https://github.com/mirage/ocaml-github/pull/253/files#diff-48784b347e44c40808a18a58ea10c171458783388aec421be3979cda23704edeL472

dra27 commented 3 years ago

Hah! That was my first attempt... up to you which version is wanted 🙂

tmcgilchrist commented 3 years ago

Either or, aesthetically I prefer the string option but the compatibility argument is 👌🏻

avsm commented 3 years ago

I'd go for the "accurate types" with the option and just fix up users. What's the point in having static types if we don't use them :-)

tmcgilchrist commented 3 years ago

Doing as a standalone PR here https://github.com/mirage/ocaml-github/pull/256