From 6630ae8d5ca6199f5421ff3b8e7d0006af2ebaa3 Mon Sep 17 00:00:00 2001 From: Jacob Quinn Date: Wed, 14 Jan 2026 00:12:37 -0700 Subject: [PATCH] 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 --- src/write.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/write.jl b/src/write.jl index 841fd1b..2f1d7a2 100644 --- a/src/write.jl +++ b/src/write.jl @@ -251,7 +251,7 @@ end StructUtils.lowerkey(::JSONStyle, s::AbstractString) = s StructUtils.lowerkey(::JSONStyle, sym::Symbol) = String(sym) StructUtils.lowerkey(::JSONStyle, n::Union{Integer, Union{Float16, Float32, Float64}}) = string(n) -StructUtils.lowerkey(::JSONStyle, x) = throw(ArgumentError("No key representation for $(typeof(x)). Define StructUtils.lowerkey(::$(typeof(x)))")) +StructUtils.lowerkey(::JSONStyle, x) = throw(ArgumentError("No key representation for $(typeof(x)). Define StructUtils.lowerkey(::JSON.JSONStyle, ::$(typeof(x)))")) """ JSON.json(x) -> String