mirage / ocaml-github

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

Fix PR#228 #232

Closed Aaylor closed 3 years ago

Aaylor commented 4 years ago

It seems that I did not tested well the last PR#228 (I may have miss to pin my changes...), introducing a regression when parsing the payload for the API function /user/orgs (where the field type is not present...).

This PR add a default value (Org for organizations, and User for users) when the field is not present in the payload. I do not know if it is the best idea, but it seems reasonable to always add the user type (instead of making it optional).

I apologize for introduced mistake...

avsm commented 4 years ago

That's quite ok! I don't use this function anywhere at the moment, so missed it as well. Could we get a test case for this, perhaps?

Aaylor commented 4 years ago

I added a new test file in the latest commit, containing different way to access the different user/org datatypes (and especially the problematic one via /user/orgs, which returns a datatype slightly different).

Aaylor commented 4 years ago

Small ping about this PR! :p

Aaylor commented 3 years ago

Rechecked, and the added tests still work. Merging the PR.