encoding.json Package

Function Description

The json package is used to process JSON data and implement conversion among String, JsonValue, and DataModel.

JsonValue is the encapsulation of the JSON data format, including object, array, string, number, true, false, and null.

For details about the DataModel, see serialization Package Document.

For details about the JSON syntax rules, see Introduction to JSON.

For details about the JSON data conversion standards, see ECMA-404 The JSON Data Interchange Standard.

API List

Interface

NameDescription
ToJsonImplements conversion between JsonValue and DataModel.

Class

NameDescription
JsonArrayCreates an empty JsonArray.
JsonBoolEncapsulates a specified Bool instance into a JsonBool instance.
JsonFloatEncapsulates a specified Float64 instance into a JsonFloat instance.
JsonIntEncapsulates a specified Int64 instance into a JsonInt instance.
JsonNullConverts a JsonNull instance into a string.
JsonObjectCreates an empty JsonObject instance.
JsonStringEncapsulates a specified String instance into a JsonString instance.
JsonValueSpecifies the JSON data layer and converts data between JsonValue and String.

Enumeration

NameDescription
JsonKindIndicates a type of JsonValue.

Exception Class

NameDescription
JsonExceptionUsed in the scenario where an exception occurs when the JsonValue type is used.