[fix][elixir] missing type mapping for AnyType (#22081)

* fix: unmapped anytype

* add tests for any type in elixir client

---------

Co-authored-by: Enrique Fernandez <enrique@bluelabs.eu>
This commit is contained in:
William Cheng 2025-10-06 15:10:10 +08:00 committed by GitHub
parent 4352a2fcd0
commit b49ec6e033
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 2 deletions

View File

@ -226,6 +226,7 @@ public class ElixirClientCodegen extends DefaultCodegen {
typeMapping.put("date", "Date.t"); typeMapping.put("date", "Date.t");
typeMapping.put("date-time", "DateTime.t"); typeMapping.put("date-time", "DateTime.t");
// other // other
typeMapping.put("AnyType", "any()");
typeMapping.put("ByteArray", "binary()"); typeMapping.put("ByteArray", "binary()");
typeMapping.put("DateTime", "DateTime.t"); typeMapping.put("DateTime", "DateTime.t");
typeMapping.put("UUID", "String.t"); typeMapping.put("UUID", "String.t");

View File

@ -2134,6 +2134,7 @@ components:
properties: properties:
"@type": "@type":
type: string type: string
any_type_property: {}
SingleRefType: SingleRefType:
type: string type: string
title: SingleRefType title: SingleRefType

View File

@ -8,11 +8,13 @@ defmodule OpenapiPetstore.Model.Any do
@derive JSON.Encoder @derive JSON.Encoder
defstruct [ defstruct [
:"@type" :"@type",
:any_type_property
] ]
@type t :: %__MODULE__{ @type t :: %__MODULE__{
:"@type" => String.t | nil :"@type" => String.t | nil,
:any_type_property => any() | nil
} }
def decode(value) do def decode(value) do