diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java index 5af1d9238904..c68ad41f8a08 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java @@ -226,6 +226,7 @@ public class ElixirClientCodegen extends DefaultCodegen { typeMapping.put("date", "Date.t"); typeMapping.put("date-time", "DateTime.t"); // other + typeMapping.put("AnyType", "any()"); typeMapping.put("ByteArray", "binary()"); typeMapping.put("DateTime", "DateTime.t"); typeMapping.put("UUID", "String.t"); diff --git a/modules/openapi-generator/src/test/resources/3_0/elixir/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/elixir/petstore-with-fake-endpoints-models-for-testing.yaml index 33b409793642..7af5e66e193f 100644 --- a/modules/openapi-generator/src/test/resources/3_0/elixir/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/elixir/petstore-with-fake-endpoints-models-for-testing.yaml @@ -2134,6 +2134,7 @@ components: properties: "@type": type: string + any_type_property: {} SingleRefType: type: string title: SingleRefType diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/any.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/any.ex index 6c3809d825bb..c61687cc2623 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/any.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/any.ex @@ -8,11 +8,13 @@ defmodule OpenapiPetstore.Model.Any do @derive JSON.Encoder defstruct [ - :"@type" + :"@type", + :any_type_property ] @type t :: %__MODULE__{ - :"@type" => String.t | nil + :"@type" => String.t | nil, + :any_type_property => any() | nil } def decode(value) do