%Tesla.Client{} uses typical middlewares such as Tesla.Middleware.Timeout or Tesla.Middleware.Fuse. When a server is unreachable for example the return value is usually something like {:error, :unavailable}. And in some cases, an exception can be thrown. However, the typespec generated by swagger codegen doesn't take this into account resulting in tons of error when doing type checking with dialyzer.
3.0.0 and latest master
defaults
Generate code for any spec
None
See here for how the typespec is generated. This should probably include no_return and {:error, term} to be accurate given it's nearly impossible to predict all errors that all middlewares can generate.
@edescourtis thanks for reporting the issue. May I know if you've time to submit a PR with the suggested fix?
cc @niku @chingor13
Perhaps! I will see what I can do.
@earldouglas
Hi, I just publish a PR that fixes typings in RequestBuilder.
The changes have fixed a lot of error more than I expected 馃槄
I guess It removes errors that is described in this issue.
So, I recommend checking that PR before you tackle this issue.
@niku I think you meant to mention @edescourtis
I'm very sorry for making a wrong mention 馃檱
Now, I send a mention to @edescourtis
Please read a comment https://github.com/swagger-api/swagger-codegen/issues/6798#issuecomment-339714863
@edescourtis https://github.com/swagger-api/swagger-codegen/pull/6821 by @niku has been merged into master. Please pull the latest master or use the SNAPSHOT version mentioned in the README to give it a try.