lune icon indicating copy to clipboard operation
lune copied to clipboard

Json & yaml encoding tables with nil elements causes a cut-off (serde)

Open TokenManiac opened this issue 1 year ago • 1 comments

print( serde.encode("json", {"foo", nil, "bar"}) )

Expected Output:

["foo",null,"bar"]

Actual Output:

["foo"]


p.s. toml encoding gives me a "unsupported rust type" error 😅

TokenManiac avatar Nov 06 '24 17:11 TokenManiac

Lua length operators are weird.

Encoding null in JSON with nil values in Lua is a pretty weird problem to solve, considering Lua has a set of obscure rules of when to consider nil a value and when not. That said, this should be considered a bug nonetheless.

CompeyDev avatar Nov 07 '24 09:11 CompeyDev