forked from loafle/openapi-generator-original
[elixir] Update dialyzer spec (#20024)
* Update evaluate_response spec to support returning a list of structs * Update elixir samples
This commit is contained in:
parent
e131d52ad0
commit
4a6dbace73
@ -160,10 +160,11 @@ defmodule {{moduleName}}.RequestBuilder do
|
||||
|
||||
### Returns
|
||||
|
||||
- `{:ok, struct}` or `{:ok, Tesla.Env.t()}` on success
|
||||
- `{:ok, struct}`, {:ok, [struct]} or `{:ok, Tesla.Env.t()}` on success
|
||||
- `{:error, term}` on failure
|
||||
"""
|
||||
@spec evaluate_response(Tesla.Env.result(), response_mapping) :: {:ok, struct()} | Tesla.Env.result()
|
||||
@spec evaluate_response(Tesla.Env.result(), response_mapping) ::
|
||||
{:ok, struct() | [struct()] | Tesla.Env.t()} | {:error, Tesla.Env.t() | any()}
|
||||
def evaluate_response({:ok, %Tesla.Env{} = env}, mapping) do
|
||||
resolve_mapping(env, mapping, nil)
|
||||
end
|
||||
|
@ -162,10 +162,11 @@ defmodule OpenapiPetstore.RequestBuilder do
|
||||
|
||||
### Returns
|
||||
|
||||
- `{:ok, struct}` or `{:ok, Tesla.Env.t()}` on success
|
||||
- `{:ok, struct}`, {:ok, [struct]} or `{:ok, Tesla.Env.t()}` on success
|
||||
- `{:error, term}` on failure
|
||||
"""
|
||||
@spec evaluate_response(Tesla.Env.result(), response_mapping) :: {:ok, struct()} | Tesla.Env.result()
|
||||
@spec evaluate_response(Tesla.Env.result(), response_mapping) ::
|
||||
{:ok, struct() | [struct()] | Tesla.Env.t()} | {:error, Tesla.Env.t() | any()}
|
||||
def evaluate_response({:ok, %Tesla.Env{} = env}, mapping) do
|
||||
resolve_mapping(env, mapping, nil)
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user