If the request body of an api is optional, the generated elixir client cannot override the param correctly with the params if given.
For instance, one can do
Api.Account.account_get_transactions(
Connection.new()
)
or
Api.Account.account_get_transactions(
Connection.new(),
[{:"GetAllTransactionsBodySchema", %{}}]
)
But no matter how we pass params into the function, it would not have any effect: (with limit 1, the response should only return 1 item)
Api.Account.account_get_transactions(
Connection.new(),
[{:"GetAllTransactionsBodySchema", %{
limit: 1
}}]
)
or
Api.Account.account_get_transactions(
Connection.new(),
[{:limit, 1}]
)
latest docker
see this make command:
https://github.com/omisego/elixir-omg/blob/862a6adfd436fbb1316be760ac6b72090127a115/priv/Makefile#L20
git clone https://github.com/omisego/elixir-omg
make init_test
make docker-nuke
docker-compose up
cd elixir-omg/priv
mix deps.get
make generate_api_code
iex -S mix
alias WatcherInfoAPI.Connection
alias WatcherInfoAPI.Api
Api.Account.account_get_transactions(
Connection.new(),
[{:"GetAllTransactionsBodySchema", %{
limit: 1
}}]
)
Workaround ourself: https://github.com/omisego/elixir-omg/pull/1302
N/A
Hey @boolafish maybe reference yaml files on a certain commit rather than master. Uf we decide to fix the spec by not allowing option params the example will be missing from this issue.
Ahh I see, you're absolutely right, the body will be wrapped into a Multipart Request, which is obviously wrong,
I'll look into this..
@boolafish or @InoMurko, would it make sense to you, if the fix would look something like this: Api.Account.account_get_transactions(conn, body: %{limit: 1})