local cjson = require "cjson"
local json = cjson.encode({
foo = "bar",
some_object = {},
some_array = cjson.empty_array
})
ngx.say(json)
local function serialize(arr)
setmetatable(arr, cjson.empty_array_mt)
return cjson.encode({some_array = arr})
end
local x=serialize({{hello="ok"},2,4})
ngx.say(x)