elixir-soap / soap

SOAP client for Elixir programming language
MIT License
135 stars 75 forks source link

Invalid function spec for Soap.call #105

Open deepankar-j opened 2 years ago

deepankar-j commented 2 years ago

The function spec for Soap.call/4 specifies that the params argument has the type map. In reality, Request.call/4 has the params type as any(). This results in the following linting error, when we supply {%{}, params} as the params value, which is valid.

The function call will not succeed.
Soap.call(
  any(),
  <<84, 114, 97, 99, [107], 66, 121, 65, 105, 114, 98, 105, 108>>,
  {%{}, %{<<_::80, _::size(24)>> => _}},
  [],
  [{:ssl, [{atom(), _}, ...]}, ...]
)
breaks the contract
(wsdl :: map(), operation :: String.t(), params :: map(), headers :: any(), opts :: any()) ::
  any()

I believe here's the change that introduced this issue.

https://github.com/elixir-soap/soap/commit/c222fd195733398c3b421373b817bd81838446ee#diff-bb4eb1a45d57965da347a74dbbf2d7018a13203a09b8a53e0f5bc46b80895763R36