brendanhay / amazonka

A comprehensive Amazon Web Services SDK for Haskell.
https://amazonka.brendanhay.nz
Other
599 stars 227 forks source link

Item in GetItemResponse is not optional #895

Closed kokobd closed 1 year ago

kokobd commented 1 year ago

The item in GetItemResponse is declared as

item :: Prelude.HashMap Prelude.Text AttributeValue

But the AWS Doc says:

If there is no matching item, GetItem does not return any data and there will be no Item element in the response.

Currently when an item is not found, I need to use resp ^. #item == mempty to check for that. Will it be better to use Maybe, or document this behavior?

endgame commented 1 year ago

We have limited control over the documentation because it is generated from service definitions, and not worth overriding in configs. See https://github.com/brendanhay/amazonka/issues/739 for how to resolve spurious Maybes in requests/responses.

endgame commented 1 year ago

Adding to 2.0 because it should be a quick fix.