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?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
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: falseoption. Maybe we could addspecs: falseoption to tellTesla.Builderto not inject@specs forget,postetc. functions?Or maybe someone has a better idea of how to solve it?
All reactions