Skip to content

Commit 6630ae8

Browse files
quinnjclaude
andcommitted
Fix misleading error message for lowerkey
The error message now correctly suggests defining `StructUtils.lowerkey(::JSON.JSONStyle, ::T)` instead of `StructUtils.lowerkey(::T)` which doesn't work. Fixes #414 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 7479829 commit 6630ae8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/write.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ end
251251
StructUtils.lowerkey(::JSONStyle, s::AbstractString) = s
252252
StructUtils.lowerkey(::JSONStyle, sym::Symbol) = String(sym)
253253
StructUtils.lowerkey(::JSONStyle, n::Union{Integer, Union{Float16, Float32, Float64}}) = string(n)
254-
StructUtils.lowerkey(::JSONStyle, x) = throw(ArgumentError("No key representation for $(typeof(x)). Define StructUtils.lowerkey(::$(typeof(x)))"))
254+
StructUtils.lowerkey(::JSONStyle, x) = throw(ArgumentError("No key representation for $(typeof(x)). Define StructUtils.lowerkey(::JSON.JSONStyle, ::$(typeof(x)))"))
255255

256256
"""
257257
JSON.json(x) -> String

0 commit comments

Comments
 (0)