From ea855dcff485899d06d8499f71bc4a4f0a786ce0 Mon Sep 17 00:00:00 2001 From: tan Date: Mon, 18 Sep 2023 12:31:48 +0530 Subject: [PATCH] add missing convert method for AnyOfAPIModel Added a missing convert method for AnyOfAPIModel from String. --- Project.toml | 2 +- src/client.jl | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 44be3cb..6f814d3 100644 --- a/Project.toml +++ b/Project.toml @@ -4,7 +4,7 @@ keywords = ["Swagger", "OpenAPI", "REST"] license = "MIT" desc = "OpenAPI server and client helper for Julia" authors = ["JuliaHub Inc."] -version = "0.1.18" +version = "0.1.19" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" diff --git a/src/client.jl b/src/client.jl index c055ddd..578779c 100644 --- a/src/client.jl +++ b/src/client.jl @@ -715,6 +715,7 @@ convert(::Type{T}, v::String) where {T<:OneOfAPIModel} = T(v) convert(::Type{T}, v::T) where {T<:AnyOfAPIModel} = v convert(::Type{T}, json::Dict{String,Any}) where {T<:AnyOfAPIModel} = from_json(T, json) convert(::Type{T}, v) where {T<:AnyOfAPIModel} = T(v) +convert(::Type{T}, v::String) where {T<:AnyOfAPIModel} = T(v) show(io::IO, model::T) where {T<:UnionAPIModel} = print(io, JSON.json(model.value, 2)) show(io::IO, model::T) where {T<:APIModel} = print(io, JSON.json(model, 2))