Skip to content

Automatically fill missing fields in incomplete objects #14

@Balletie

Description

@Balletie

In several parts of the API GitHub responds with incomplete representations when it is part of another response. They probably do this to save bandwidth.

For example, when one gets the JSON representation of an issue, the API responds with a JSON object containing a "user" key which contains an incomplete JSON representation of a user. When parsed into a GHUser, it contains a lot of nil fields.

To resolve this, there needs to be a check against this, and the fields should be filled lazily using the API url of the object itself. That is, in the case of GHUser, it should do something like this when a field is not filled:

fillFields
| updated |
updated := self
    get: self url;
    responseAs: self class.
self mergeFieldsFrom: updated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions