ex-aws / ex_aws

A flexible, easy to use set of clients AWS APIs for Elixir
https://hex.pm/packages/ex_aws
MIT License
1.28k stars 526 forks source link

Update spec for `Config.new/2` function #876

Closed kendralockard closed 2 years ago

kendralockard commented 2 years ago

This PR updates the return type in spec for Config.new/2. Currently, the spec says that the return is specifically an empty map %{}, whereas I believe it should be the overall type map().

For posterity's sake, I discovered this error when I tried to call S3.presigned_post/4 like so:

ExAws.Config.new(:s3)
|> ExAws.S3.presigned_post("bucket", "key")

which threw the following Dialyzer warning:

The call 'Elixir.ExAws.S3':presigned_post
         (#{},
          <<...>>,
          <<...>>) will never return since it differs in the 1st argument from the success typing arguments: 
         (#{'json_codec' := atom(), _ => _},
          binary(),
          'nil' | binary())

By the way, I'm using this project with DigitalOcean spaces for my Elixir project, and it is awesome! Thanks so much for all of your work on it!

kendralockard commented 2 years ago

Hi! Any chance this could be merged soon? It'd be very helpful for my project that depends on this library. Thanks!

bernardd commented 2 years ago

Thanks very much @kendralockard!