TSON is a human-readable data interchange format with a syntax similar to JSON. TSON preserves type information for every value.
TSON supports POCO serialization/deserialization. You can configure them using the TsonProperty
and TsonIgnore
attributes.
A configuration object can also be passed in to the serialization and deserialization methods. Common usage example: To include private members during serialization.
{
"name": string("My Cool Adventure"),
"plays": uint(150),
"reputation": int(-2),
"visible": bool(false),
"data": bytes("UTIHCQsOEBIUFxkbHSAiJCYHCQsOEBIUFxkbHSAiJCYICAg="),
"created": datetime("2020-05-13T10:06:09.5137659-04:00")
}
// serialize an object into a TSON string.
var serialized = TsonConvert.Serialize(input, Formatting.Indented);
// deserialize a TSON string into a Dictionary<string, object>
var deserialized = TsonConvert.Deserialize(input);
// deserialize a TSON string into a class.
var deserialized = TsonConvert.Deserialize<ShopItems>();
- Object
- Array
- Literals
- string
- bool
- int
- uint
- long
- ulong
- char
- short
- ushort
- float
- double
- sbyte
- byte
- bytes
- null
- datetime
- uri