Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elixir API client deserialisation error when parsing enum values #355

Open
5 tasks done
tomwilsonsb opened this issue May 14, 2024 · 2 comments
Open
5 tasks done
Labels
bug Something is not working.

Comments

@tomwilsonsb
Copy link

Preflight checklist

Ory Network Project

No response

Describe the bug

The elixir client has some issues when parsing response data that contains "enums"

Reproducing the bug

E.g. when calling: Ory.Api.Frontend.to_session(Ory.Connection.new, [Cookie: cookie])

I get the following error:


    The following arguments were given to Ory.Deserializer.to_struct/2:

        # 1
        "aal1"

        # 2
        Ory.Model.AuthenticatorAssuranceLevel

    Attempted function clauses (showing 3 out of 3):

        defp to_struct(nil, _)
        defp to_struct(list, module) when is_list(list) and is_atom(module)
        defp to_struct(map, module) when is_map(map) and is_atom(module)

    (ory_client 1.6.2) lib/ory/deserializer.ex:97: Ory.Deserializer.to_struct/2
    (elixir 1.15.7) lib/map.ex:916: Map.update!/3
    (ory_client 1.6.2) lib/ory/model/session_authentication_method.ex:31: Ory.Model.SessionAuthenticationMethod.decode/1
    (elixir 1.15.7) lib/enum.ex:1693: Enum."-map/2-lists^map/1-1-"/2
    (elixir 1.15.7) lib/map.ex:916: Map.update!/3
    (ory_client 1.6.2) lib/ory/model/session.ex:42: Ory.Model.Session.decode/1
    (ory_client 1.6.2) lib/ory/deserializer.ex:19: Ory.Deserializer.jason_decode/2
    iex:2: (file)

It is potentially caused by this bug I found on the open-api-generator GitHub: OpenAPITools/openapi-generator#16412

Relevant log output

No response

Relevant configuration

No response

Version

1.6

On which operating system are you observing this issue?

None

In which environment are you deploying?

None

Additional Context

No response

@tomwilsonsb tomwilsonsb added the bug Something is not working. label May 14, 2024
@binajmen
Copy link

binajmen commented Jul 2, 2024

@aeneasr Apologies for the ping, but is this bug being tracked? I want to integrate Ory into our Elixir API server, but the Ory client isn't usable in its current state.

@aeneasr
Copy link
Member

aeneasr commented Jul 8, 2024

I believe this should be fixed now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working.
Projects
None yet
Development

No branches or pull requests

3 participants