json.lua
json.lua copied to clipboard
Decoding fails for JSON with array of strings within an object.
Hi,
This example seems to cause errors:
{"this":["is", "a", "minimal", "example"]}
It gives an error at symbol 10; the opening square bracket.
Can you provide more information? I tried to reproduce but without success. Worked as it should for me.
-- File: runtime.lua
local json = require("json")
local decoded = json.decode('{"this":["is", "a", "minimal", "example"]}')
print(#decoded["this"])
# Terminal
$ luajit ./runtime.lua
4