To be consistent with the behavior of luci-lib-json, an empty Lua table should be encoded to an empty JSON list, not an empty JSON object. To still allow encoding empty JSON objects, the usage of anything other than a number or a string as a key (for example an empty table or a function) can be used to force encoding as an object: json.stringify({}) -- "[]" json.stringify({[{}] = true}) -- "{}" Signed-off-by: Jan-Philipp Litza <janphilipp@litza.de> |
||
---|---|---|
.. | ||
luci-lib-httpclient | ||
luci-lib-ip | ||
luci-lib-json | ||
luci-lib-jsonc | ||
luci-lib-luaneightbl | ||
luci-lib-nixio | ||
luci-lib-px5g | ||
luci-lib-rpcc |