You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Obviously, it breaks the middleware contract since it returns {:ok, any()} instead of {:ok, %Tesla.Env{}}. But as long as you keep such middleware at the tail of the response handlers chain it works perfectly fine and I'm okay with it.
The problem is that Dyalizer is not okay with it.
defmoduleClientdouseTeslaplugHandleResponse# ... plug other middlewareend{:ok,%{"json"=>"here"}}=Client.get("url")# dialyzer gets crazy
Tesla already supports docs: false option. Maybe we could add specs: false option to tell Tesla.Builder to not inject @specs for get, post etc. functions?
Or maybe someone has a better idea of how to solve it?
The text was updated successfully, but these errors were encountered:
Hi there 👋.
First of all many thanks for a great library.
I like to have a common response handler that does the response status check and unwraps the body.
It can be easily achieved by implementing a middleware:
Obviously, it breaks the middleware contract since it returns
{:ok, any()}
instead of{:ok, %Tesla.Env{}}
. But as long as you keep such middleware at the tail of the response handlers chain it works perfectly fine and I'm okay with it.The problem is that Dyalizer is not okay with it.
Tesla already supports
docs: false
option. Maybe we could addspecs: false
option to tellTesla.Builder
to not inject@spec
s forget
,post
etc. functions?Or maybe someone has a better idea of how to solve it?
The text was updated successfully, but these errors were encountered: