Table of Contents

Class SerializationPayloadEditor

Namespace
Chronicler.Serialization
Assembly
Chronicler.dll

Edits JSON properties and MemoryPack entries without populating a recordable object graph.

public static class SerializationPayloadEditor
Inheritance
SerializationPayloadEditor
Inherited Members

Remarks

Paths and replacement values must match the recorded schema. Replacement values use the selected transport serializer directly; editing does not invoke RecordData(IChronicler). Use the format-specific record serializers to serialize and populate records.

Methods

RemoveJsonProperty(string, params string[])

Removes a property from a JSON payload at the specified path.

public static string RemoveJsonProperty(string json, params string[] path)

Parameters

json string

The JSON payload.

path string[]

The path to the property to remove.

Returns

string

The modified JSON payload.

Exceptions

ArgumentException

RemoveMemoryPackEntry(byte[], params string[])

Removes a MemoryPack entry from a serialized payload at the specified path.

public static byte[] RemoveMemoryPackEntry(byte[] data, params string[] path)

Parameters

data byte[]

The serialized MemoryPack payload.

path string[]

The path to the entry to remove.

Returns

byte[]

The modified serialized MemoryPack payload.

Exceptions

ArgumentException

SetJsonValue<T>(string, T, params string[])

Sets a property value in a JSON payload at the specified path.

public static string SetJsonValue<T>(string json, T value, params string[] path)

Parameters

json string

The JSON payload.

value T

The value to set.

path string[]

The path to the property to set.

Returns

string

The modified JSON payload.

Type Parameters

T

The type of the value to set.

Exceptions

ArgumentException

SetMemoryPackValue<T>(byte[], T, params string[])

Sets a MemoryPack entry value in a serialized payload at the specified path.

public static byte[] SetMemoryPackValue<T>(byte[] data, T value, params string[] path)

Parameters

data byte[]

The serialized MemoryPack payload.

value T

The value to set.

path string[]

The path to the entry to set.

Returns

byte[]

The modified serialized MemoryPack payload.

Type Parameters

T

The type of the value to set.

Exceptions

ArgumentException