monkeyDluffy6017 commented on issue #8111:
URL: https://github.com/apache/apisix/issues/8111#issuecomment-1285073315

   Have you learn about this command: 
https://github.com/openresty/lua-cjson#decode_array_with_array_mt ?
   It shows the example already.
   ```
   local cjson = require "cjson"
   
   -- default behavior
   local my_json = [[{"my_array":[]}]]
   local t = cjson.decode(my_json)
   cjson.encode(t) -- {"my_array":{}} back to an object
   
   -- now, if this behavior is enabled
   cjson.decode_array_with_array_mt(true)
   
   local my_json = [[{"my_array":[]}]]
   local t = cjson.decode(my_json)
   cjson.encode(t) -- {"my_array":[]} properly re-encoded as an array
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to