Module json
Functions
| to_json (value) | ⚠️. |
| from_json (text[, schema[, constructors]]) | ⚠️. |
Functions
- to_json (value)
-
⚠️. This function gets the value data with the data.to_data() function. Then the function transforms this data into the JSON.
Parameters:
- value any
Returns:
Or
- nil
- string error message
- from_json (text[, schema[, constructors]])
-
⚠️. This function transforms the text in the JSON to a data.
Parameters:
- text string
- schema tab JSON Schema (optional)
- constructors
{[string]=func,...}
constructors for tables with the
__nameproperty; the values should befunc(options: tab): tab; the constructor can either return an error as the second result or throw it as an exception (optional)
Returns:
-
any
Or
- nil
- string error message