Skip to content

Elixir generator AnyType support #14070

Closed
@paulbalomiri

Description

@paulbalomiri
Description

When compiling spec files which contain AnyType, the elixir generator expects a :struct type to be used in decoder.ex.

The generated code fails because no type <PKG>.Model.AnyType exists

Example Generated code found here:

defimpl Poison.Decoder, for: Ory.Model.OAuth2Client do
  import Ory.Deserializer
  def decode(value, options) do
    value
    |> deserialize(:jwks, :struct, Ory.Model.AnyType, options)
    |> deserialize(:metadata, :struct, Ory.Model.AnyType, options)
  end
end
openapi-generator version

6.0.3 to latest in main branch

Related issues/PRs

The proposed fix will reference this issue and builds on the latest work by @halostatue.

I also include the related elixir issues from #12731.

Suggest a fix/enhancement

When work on my branch is finished I intend to submit a PR

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions