exhal icon indicating copy to clipboard operation
exhal copied to clipboard

Dialyzer type warning in `ExHal.Client.get/2` as shown in docs

Open alexslade opened this issue 8 years ago • 1 comments

Hi Peter 👋

I'm liking the library, but as an Elixir newbie I'm confused by this error. A literal copy-paste of your example code is yielding a type warning, and my digging around isn't making it clear why. Could you point me in the right direction? I'd be happy to issue a PR with a fix when I understand it.

{:ok, doc, _response_header} =
  ExHal.client()
  |> ExHal.Client.add_headers("User-Agent": "MyClient/1.0")
  |> ExHal.Client.get("http://example.com/hal")

screen shot 2018-01-09 at 21 26 04

I can see that's there's an opaque type defined for Client, but there's no typespec for get which is confusing me...

alexslade avatar Jan 09 '18 21:01 alexslade

Alex, exhal is only partially covered to use the specs at this time. I have been using the for documentation purposes rather than for verification.

I plan on getting the rest of the code base annotated with type specs over time. I'd definitely merge PRs to add type specs.

pezra avatar Jan 10 '18 15:01 pezra