I noticed that json’s encoding and decoding creates differences with lua tables
As in the example:
local test = { name = "test", other = "my other string", { kind = "Rect", --ecc, }, { kind = "Rect", --ecc, }, { kind = "Rect", --ecc, }, } print(#test) -- 3 for i=1, #test do --my code end local json = require("json") local encodeTable = json.encode( test ) local decodeTable = json.decode( encodeTable ) print(#decodeTable) -- 0 for i = 1, #decodeTable do --my code end
The second time I get that the decoded table length is equal to 0, can this be fixed?