Skip to content

Commit a63766e

Browse files
authored
add missing convert method for AnyOfAPIModel (#62)
Added a missing convert method for AnyOfAPIModel from String.
1 parent c563a12 commit a63766e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ keywords = ["Swagger", "OpenAPI", "REST"]
44
license = "MIT"
55
desc = "OpenAPI server and client helper for Julia"
66
authors = ["JuliaHub Inc."]
7-
version = "0.1.18"
7+
version = "0.1.19"
88

99
[deps]
1010
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

src/client.jl

+1
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,7 @@ convert(::Type{T}, v::String) where {T<:OneOfAPIModel} = T(v)
715715
convert(::Type{T}, v::T) where {T<:AnyOfAPIModel} = v
716716
convert(::Type{T}, json::Dict{String,Any}) where {T<:AnyOfAPIModel} = from_json(T, json)
717717
convert(::Type{T}, v) where {T<:AnyOfAPIModel} = T(v)
718+
convert(::Type{T}, v::String) where {T<:AnyOfAPIModel} = T(v)
718719

719720
show(io::IO, model::T) where {T<:UnionAPIModel} = print(io, JSON.json(model.value, 2))
720721
show(io::IO, model::T) where {T<:APIModel} = print(io, JSON.json(model, 2))

0 commit comments

Comments
 (0)