-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
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?