Skip to content

Get Sansar

Script API

JsonSerializer

Where: Client
More page actions

For the complete documentation index, see llms.txt. This page is also available as Markdown.

Class Namespace Sansar.Utility

Converts objects to and from javascript object notation strings

public static class JsonSerializer

Members at a glance

KindMembers
MethodsDeserialize · Serialize

Methods

Deserialize

public static void Deserialize<T>(     string value,     Action<JsonSerializationData<T>> done )

Converts the given string to an object.

ParameterTypeDescription
valuestringThe string in json notation.
doneAction<JsonSerializationData<T>>The action to call when the conversion is complete.

Type parameters: T: The type to create.

public static void Deserialize<T>(     string value,     JsonSerializerOptions options,     Action<JsonSerializationData<T>> done )

Converts the given string to an object.

ParameterTypeDescription
valuestringThe string in json notation.
optionsJsonSerializerOptionsOptions to control the deserialization.
doneAction<JsonSerializationData<T>>The action to call when the conversion is complete.

Type parameters: T: The type to create.

Serialize

public static void Serialize<T>(     T value,     Action<JsonSerializationData<T>> done )

Converts the given object to a Json string

ParameterTypeDescription
valueTThe object to be converted
doneAction<JsonSerializationData<T>>The action to call when the conversion is complete.

Type parameters: T: The type of the object to convert. This can usually be inferred.

public static void Serialize<T>(     T value,     JsonSerializerOptions options,     Action<JsonSerializationData<T>> done )

Converts the given object to a Json string

ParameterTypeDescription
valueTThe object to be converted
optionsJsonSerializerOptionsOptions to control the serialization.
doneAction<JsonSerializationData<T>>The action to call when the conversion is complete.

Type parameters: T: The type of the object to convert. This can usually be inferred.

Generated from the Sansar 47.10.0 client ScriptApi snapshot.