Hi,
I recently ran into the issue of decoding and re-encoding json arrays with cjson.
Looking around, the openresty/cjson fork mentions:
This fork of mpx/lua-cjson is included in the OpenResty bundle and includes a few bugfixes and improvements, especially to facilitate the encoding of empty tables as JSON Arrays.
The openresty/cjson fork includes the method `decode_array_with_array_mt`:
$ ag '_array_mt"'
/tmp/lua-cjson/lua_cjson.c
1439: { "decode_array_with_array_mt", json_cfg_decode_array_with_array_mt },
1491: lua_setfield(l, -2, "empty_array_mt");
The method `decode_array_with_array_mt` is not present in the latest openresty bundle 1.13.6.1:
$ ag '_array_mt"'
/tmp/openresty-1.13.6.1/bundle/lua-cjson-2.1.0.5/lua_cjson.c
1445: lua_setfield(l, -2, "empty_array_mt");
Looking at the openresty repo, it appears that the latest cjson bundled will be 2.1.0.6rc2. Will that contain the array decoding patch?
Thanks,
H.