Represents a set of functions for serialization, deserialization and optionally serialization for URIs. The return type of the deserialize function is the type of the input to the serialize and serializeToUri functions.

interface DeSerializer<DeserializedT> {
    deserialize: (value: any) => DeserializedT;
    serialize: (value: DeserializedT) => any;
    serializeToUri?: (
        value: DeserializedT,
        serialize: (value: DeserializedT) => any,
    ) => string;
}

Type Parameters

  • DeserializedT

    The return type of deserialize and input of serialize and serializeToUri.

Properties

deserialize: (value: any) => DeserializedT

Function to deserialize a value which is usually a string.

Type declaration

serialize: (value: DeserializedT) => any

Function to serialize a value.

Type declaration

serializeToUri?: (
    value: DeserializedT,
    serialize: (value: DeserializedT) => any,
) => string

Function to serialize a value for use in a URI. This function is optional. If not specified, the serialize function will be used.

Type declaration

    • (value: DeserializedT, serialize: (value: DeserializedT) => any): string
    • Parameters

      • value: DeserializedT

        Deserialized value to serialize.

      • serialize: (value: DeserializedT) => any

        A reference to the serialize function which is usually used to serialize the payload.

      Returns string

      Serialized value for URIs.

      Copyright Ⓒ 2024 SAP SE or an SAP affiliate company. All rights reserved.