[elixir] Update dialyzer spec (#20024)

* Update evaluate_response spec to support returning a list of structs

* Update elixir samples
This commit is contained in:
Nate Todd 2024-12-04 02:25:24 -05:00 committed by GitHub
parent e131d52ad0
commit 4a6dbace73
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -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