-
Notifications
You must be signed in to change notification settings - Fork 105
Open
Description
This doesn't work.
julia> struct A end
julia> JSON.json(A() => 1)
ERROR: ArgumentError: No key representation for A. Define StructUtils.lowerkey(::A)
...
julia> StructUtils.lowerkey(::A) = "a";
julia> JSON.json(A() => 1)
ERROR: ArgumentError: No key representation for A. Define StructUtils.lowerkey(::A)This works, but it's unclear if this is the intended fix.
julia> StructUtils.lowerkey(::JSON.JSONStyle, ::A) = "a";
julia> JSON.json(A() => 1)
"{\"a\":1}"error source:
Line 238 in 0c9b900
| StructUtils.lowerkey(::JSONStyle, x) = throw(ArgumentError("No key representation for $(typeof(x)). Define StructUtils.lowerkey(::$(typeof(x)))")) |
Metadata
Metadata
Assignees
Labels
No labels