From 8425450abe7a3f5e8cdc709ea830698b5ccd824c Mon Sep 17 00:00:00 2001 From: Doug Beardsley Date: Fri, 17 Apr 2020 07:58:33 -0400 Subject: [PATCH] Make repoWebhookResponseStatus optional I have encountered situations where the `repoWebhookResponseStatus` field returned by GitHub is `null` (in my case it was in last_response). When this happens, I get the following error: ``` ParseError "Error in $[1]['last_response'].status: expected Text, encountered Null" ``` Unfortunately I can't find anything in the documentation (https://developer.github.com/v3/repos/hooks/) indicating that the status field is nullable. At any rate, this PR fixes the problem for me. --- src/GitHub/Data/Webhooks.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GitHub/Data/Webhooks.hs b/src/GitHub/Data/Webhooks.hs index e58f8e69..f25cf415 100644 --- a/src/GitHub/Data/Webhooks.hs +++ b/src/GitHub/Data/Webhooks.hs @@ -89,7 +89,7 @@ instance Binary RepoWebhookEvent data RepoWebhookResponse = RepoWebhookResponse { repoWebhookResponseCode :: !(Maybe Int) - , repoWebhookResponseStatus :: !Text + , repoWebhookResponseStatus :: !(Maybe Text) , repoWebhookResponseMessage :: !(Maybe Text) } deriving (Show, Data, Typeable, Eq, Ord, Generic)