json_decode.. is very wrong at decoding JSON.
Code Snippet (if applicable) to Reproduce Problem:
/client/verb/testDecode()
var/decoded = json_decode("{\"data\":{\"number\":\"10\"},\"status\":\"ok\"}")
for(var/k in decoded)
world << "[k] = [decoded[k]] (\ref[decoded[k]])"
if( istype( decoded[k], /list ) )
world << "{"
for(var/k2 in decoded[k])
world << "\t[k2] = [decoded[k][k2]] (\ref[decoded[k][k2]])"
world << "}"
Expected Results:
data = /list ([0xf000002])
{
number = 10 ([0x6b200000])
}
status = ok ([0x6000158])
Actual Results:
ok = /list ([0xf000003])
{
}
status = ok ([0x6000239])
I've also gotten the equivalent of list("data" = list("ok" = 10), status = "ok") as a result
Does the problem occur:
Every time
When does the problem NOT occur?
Never?
Workarounds:
Use a DM library