Module rsjson¶
Require: require("rsjson")
Index¶
Function
Deserialize a JSON string into a Lua object |
|
Serialize a Lua object into a JSON string |
Class
A metatable attachable to a Lua table to systematically encode it as Array (instead of Map). As a result, encoded Array will contain only sequence part of the table, with the same length as the # operator on that table. |
|
Represents the JSON null value. This can be used in the place of nil to represent empty values. |
Alias
Api reference¶
-
alias rsjson.EncodeConfig =
rs_mod_lua_core.EncodeConfig¶
-
alias rsjson.DecodeConfig =
rs_mod_lua_core.DecodeConfig¶
-
class rsjson.null:
lightuserdata¶ Represents the JSON
nullvalue. This can be used in the place ofnilto represent empty values.
-
class rsjson.array_metatable:
table¶ A metatable attachable to a Lua table to systematically encode it as Array (instead of Map). As a result, encoded Array will contain only sequence part of the table, with the same length as the # operator on that table.
-
rsjson.encode(obj:
any, config?:rsjson.EncodeConfig):string¶ Serialize a Lua object into a JSON string
- Parameters:
obj (
any) – Any Lua object- Returns:
_1 (
string) – The serialized Lua object
-
rsjson.decode(str:
string, config?:rsjson.DecodeConfig):any¶ Deserialize a JSON string into a Lua object
- Parameters:
str (
string) – The JSON string- Returns:
_1 (
any) – The deserialized JSON object