openresty/lua-cjson

how to resovle decode a empty table to array and object separately?

sniper-xx opened this issue · 3 comments

how to resovle decode a empty table to array and object separately?

The json data from the backend server, both have empty array and empty object. when decode the json data, it's only to controll cjson decode either to array or to object. but that leads to troubles. Is there any resolution to resolve this proplem?

It's solved using decode_array_with_array_mt. thanks!

@sniper-xx you just saved me so much time. Thank you.