Header menu logo FCQRS

Serialization Module

Provides JSON serialization and deserialization functionality for FCQRS.

Functions and values

Function or value Description

decode json

Full Usage: decode json

Parameters:
    json : JsonElement - The JSON element to deserialize.

Returns: 'T The deserialized object.

Deserializes a JSON element to a strongly-typed object.

json : JsonElement

The JSON element to deserialize.

Returns: 'T

The deserialized object.

InvalidOperationException Thrown when the deserialized value is null.

decodeFromBytes json

Full Usage: decodeFromBytes json

Parameters:
    json : byte array - The byte array containing JSON data.

Returns: 'T The deserialized object.

Deserializes a byte array to a strongly-typed object.

json : byte array

The byte array containing JSON data.

Returns: 'T

The deserialized object.

InvalidOperationException Thrown when the deserialized value is null.

encode obj

Full Usage: encode obj

Parameters:
    obj : 'a - The object to serialize.

Returns: string A JSON string representation of the object.

Serializes an object to a JSON string.

obj : 'a

The object to serialize.

Returns: string

A JSON string representation of the object.

encodeToBytes obj

Full Usage: encodeToBytes obj

Parameters:
    obj : 'a - The object to serialize.

Returns: byte[] A byte array containing the JSON representation of the object.

Serializes an object to a UTF-8 byte array.

obj : 'a

The object to serialize.

Returns: byte[]

A byte array containing the JSON representation of the object.

jsonOptions

Full Usage: jsonOptions

Returns: JsonSerializerOptions

Default JSON serializer options configured for F# types.

Returns: JsonSerializerOptions

Type something to start searching.