Thanks to visit codestin.com
Credit goes to github.com

Skip to content

WebHookPayload incorrectly defines repo/organization #302

@aleemstreak

Description

@aleemstreak

I'm trying to use the WebHookPayload struct to deserialize a webhook received by my server from Github.

The WebHookPayload is mostly defined correctly, however, it includes a Repo field of type Repository. Repository has a field name organization of type Organization.

However, when receiving webhooks for push events, this organization field is actually sent as a string id by github, not the nested Organization object.

This cases decoding json of a webhook to a WebHookPayload to fail. I'd like to contribute a fix however, I'm looking for suggestions on the best way to do this. Since the Repository struct is used all over the place, can't really change that struct. The only thing I can think of is to create a WebHookRepository struct that is 99% the same except for the organization field.

Any other ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions