jkakar / aws-elixir

AWS clients for Elixir
Other
191 stars 0 forks source link

Error Message for Rekognition.detect_faces() #62

Closed bbtb1982 closed 3 years ago

bbtb1982 commented 7 years ago

After extensive trial and error. I figured out that Rekognition.detect_faces() is expecting a map with these keys. I was able to easily determine from the response signature in the module that opts was to be a map but not the keys that were expected. Mostly that Image: and not "Image", "image", or "--image"

successful request

 Client |> AWS.Rekognition.detect_faces(%{Image: %{S3Object: %{Bucket: "some_bucket", Name: "some_name" }}))

Previous to this I was getting this error:

{:error, {"ValidationException", "1 validation error detected: Value null at 'image' failed to satisfy constraint: Member must not be null"}}

What I'm confused about is that the key specified is a string image (lowercase) not an Atom first letter capitalized. I even reviewed the docs for AWS Go and that didn't seem to help me understand the error messages. I'm assuming there are several sources for errors messages. HTTPoision, Poision and AWS cli. To make this repo more user friendly we need to add.

Let me know what you think on driving this forward. I would be willing to do some basic work documenting as figuring out this was a horribly time consuming.

bbtb1982 commented 7 years ago

Looking into this further I found followed the link from aws-codegen to the aws-sdk-go/models/apis/ that generate the modules for this package. The apis list the arguments their types and errors for each module.

jkakar commented 7 years ago

A thing I've wanted to do for awhile, but not made time for, is to generate input, output and error structs (just like the AWS SDK for Go does) to make this kind of discovery easier. Sorry for the high friction experience. :/