You can clone with
Not sure if this is the right place to log this issue (another specific cjson issues list?) anyway, this happens:
redis 127.0.0.1:6379> eval "return cjson.encode(cjson.decode(''))" 0
Which basically creates some bugs when decoding and encoding JSON objects using LUA when there's an empty array as a value somewhere..
This seems similar (another Lua Json lib)henkel/lua-json@effee88http://gregoryjamesray.com/post/3870348819/json4lua-and-empty-arrays
I think it's not a bug but a limitation of the lua language. The lua language uses tables to implement both array- and hash-type data structures. When decoding an empty hash or array from json they are both mapped to an empty lua table. There is no way of distinguishing them in lua.
thanks @databus23, I must have misread some code I linked, I re-read it just now and it seems that there was no work-around by some interesting technique as I have hoped..
Thanks for the reply.