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"
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.