Json
Library for parsing JSON.
- namespace Json
enum JsonSerializerFlag[link]
Bitmasked enum options for the JSON serializer.
Name | Description |
---|---|
DEFAULT | Bitmask of 0. Indicates the absence of other option flags. |
PRETTY | When enabled, includes whitespace in the output. |
OMIT_DICTIONARY_NULLS | Dictionary keys that have null values will not be serialized. |
function parseJson(rawJsonString, failSilently)[link]
Parses the JSON string into a dictionary object.
Arguments
Name | Type | Optional | Description |
---|---|---|---|
rawJsonString | string | Raw input text to parse. |
|
failSilently | boolean | Optional | Default is false. If true, syntax errors will not cause an exception and null will be returned instead. |
Return Value
Type | Description |
---|---|
dictionary | A structured JSON object in the form of a dictionary. |
function serialize(object, flags, depth)[link]
Serializes a dictionary object into a JSON string.
Arguments
Name | Type | Optional | Description |
---|---|---|---|
object | dictionary | Dictionary object to serialize into JSON. |
|
flags | Json.JsonSerializerFlag | Optional | Bitmask of flags for special options. See JsonSerializerFlag for more information. Default value is JsonSerializerFlag.DEFAULT |
depth | integer | Optional | To prevent infinite recursion, this is a maximum recursion depth. Default value is 64. |
Return Value
Type | Description |
---|---|
string | A JSON string. |
class JsonException[link]
An exception thrown upon a parsing or serializing error.