ERROR: MethodError: Cannot `convert` an object of type Dict{String, Any} to an object of type String
The function `convert` exists, but no method is defined for this combination of argument types.
Closest candidates are:
convert(::Type{String}, ::JSON.PtrString)
@ JSON ~/.julia/packages/JSON/gMdcG/src/lazy.jl:428
convert(::Type{String}, ::String)
@ Base essentials.jl:461
convert(::Type{T}, ::T) where T<:AbstractString
@ Base strings/basic.jl:232
...
Stacktrace:
[1] setindex!(h::Dict{String, String}, v0::Dict{String, Any}, key::String)
@ Base ./dict.jl:355
[2] resolve_refs!(schema::Dict{String, String}, uri::URIs.URI, id_map::Dict{String, Any}, parent_dir::String)
@ JSONSchema ~/.julia/dev/JSONSchema/src/schema.jl:164
[3] resolve_refs!(schema::Dict{String, Dict{String, String}}, uri::URIs.URI, id_map::Dict{String, Any}, parent_dir::String)
@ JSONSchema ~/.julia/dev/JSONSchema/src/schema.jl:181
[4] resolve_refs!(schema::Dict{String, Dict{String}}, uri::URIs.URI, id_map::Dict{String, Any}, parent_dir::String)
@ JSONSchema ~/.julia/dev/JSONSchema/src/schema.jl:181
[5] _
@ ~/.julia/dev/JSONSchema/src/schema.jl:262 [inlined]
[6] Schema(schema::Dict{String, Dict{String}})
@ JSONSchema ~/.julia/dev/JSONSchema/src/schema.jl:249
[7] top-level scope
@ REPL[13]:1
First of all, thanks for this package, I'm finding it very helpful.
I've encountered a small bug (easy to work around, but it did take me a little bit to figure out what was happening). If a dictionary containing a
$refis too strictly typed, the machinery in JSONSchema fails when trying to expand it to its definition.Full stacktrace
Widening the container type fixes the issue:
but I imagine this could be done automatically by JSONSchema when copying the user-provided nested dict.