From JSON3 I expected a Pair to be serialized as an Object, but I find:
julia> JSON3.write("message" => "Hello World!")
"{\"message\":\"Hello World!\"}"
julia> JSON.json("message" => "Hello World!")
"{\"first\":\"message\",\"second\":\"Hello World!\"}"
and
julia> JSON3.write(["message" => "Hello World!"])
"[{\"message\":\"Hello World!\"}]"
julia> JSON.json(["message" => "Hello World!"])
"[\"Hello World!\"]"
Is this behaviour by purpose?
I could solve the issue by defining
JSON.lower(p::Pair) = JSON.Object(Symbol(p.first) => p.second)
JSON.lower(::JSON.JSONStyle, pp::AbstractVector{<:Pair}) = JSON.Object(pp)
But I guess such lowering should be done rather in a private JSONStyle then?