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
Returns
- string
The modified JSON payload.
Exceptions
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
Returns
- byte[]
The modified serialized MemoryPack payload.
Exceptions
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
jsonstringThe JSON payload.
valueTThe value to set.
pathstring[]The path to the property to set.
Returns
- string
The modified JSON payload.
Type Parameters
TThe type of the value to set.
Exceptions
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
databyte[]The serialized MemoryPack payload.
valueTThe value to set.
pathstring[]The path to the entry to set.
Returns
- byte[]
The modified serialized MemoryPack payload.
Type Parameters
TThe type of the value to set.