ory / sdk

The place where ORY's SDKs are being auto-generated
Apache License 2.0
141 stars 85 forks source link

Ory Hydra Client for Elixir has a typo which breaks the client #285

Open ah0y opened 1 year ago

ah0y commented 1 year ago

Preflight checklist

Describe the bug

  def authorization(token, _scopes) when is_binary(token) do
    {Tesla.Middleware.Headers, ["authorization", token]}
  end

should be

 def authorization(token, _scopes) when is_binary(token) do
     {Tesla.Middleware.Headers, [{"authorization", token}]}
  end

Reproducing the bug

Try running any requests

Relevant log output

** (FunctionClauseError) no function clause matching in anonymous fn/1 in Tesla.Adapter.Httpc.request/2    

    The following arguments were given to anonymous fn/1 in Tesla.Adapter.Httpc.request/2:

        # 1
        "authorization"

    (tesla 1.7.0) lib/tesla/adapter/httpc.ex:55: anonymous fn/1 in Tesla.Adapter.Httpc.request/2
    (elixir 1.14.4) lib/enum.ex:1658: Enum."-map/2-lists^map/1-0-"/2
    (elixir 1.14.4) lib/enum.ex:1658: Enum."-map/2-lists^map/1-0-"/2
    (tesla 1.7.0) lib/tesla/adapter/httpc.ex:55: Tesla.Adapter.Httpc.request/2
    (tesla 1.7.0) lib/tesla/adapter/httpc.ex:22: Tesla.Adapter.Httpc.call/2
    (ory_hydra 2.2.0-pre.0) lib/ory/api/o_auth2.ex:644: Ory.Api.OAuth2.o_auth2_authorize/2
    iex:5: (file)


### Relevant configuration

_No response_

### Version

e471477af9c733ee7b84a6c869a35d4a5f17b67e

### On which operating system are you observing this issue?

macOS

### In which environment are you deploying?

Ory Network

### Additional Context

_No response_
tobbbles commented 1 year ago

I've proposed a fix to the upstream generator.

This will need to be fixed upstream and we'll look to upgrade the elixir generation to 7.0.1 of the openapi-generator once it's released.

However there is currently a breaking change in 7.0.0 preventing us to upgrade, so we will need to wait until https://github.com/OpenAPITools/openapi-generator/issues/16412 is resolved before moving forward