ssanj · GitHub

The submitted_at field in the PullRequest Review is currently decoded as mandatory:

instance FromJSON Review where
    parseJSON =
        withObject "Review" $ \o ->
            Review <$> o .: "body" <*> o .: "commit_id" <*> o .: "state" <*>
            o .: "submitted_at" <*>
            o .: "pull_request_url" <*>
            o .: "html_url" <*>
            o .: "user" <*>
            o .: "id"

https://github.com/phadej/github/blob/1119ad464706810e9b7db47b93d0b6a46dafbda8/src/GitHub/Data/Reviews.hs#L50

The Github API documentation states that:

Pull request reviews created in the PENDING state do not include the submitted_at property in the response.
https://docs.github.com/en/rest/reference/pulls#create-a-review-for-a-pull-request

I was bitten by this bug on Friday, where I was retrieving a Review in PENDING state.

I'm happy to get some pointers on the implementation.

Read the original on github.com ↗