Interface representing the return type of the builder function entitySerializer.

interface EntitySerializer {
    serializeComplexType: <
        ComplexTypeNamespaceT extends ComplexTypeNamespace<any> = any,
    >(
        fieldValue: any,
        complexTypeNameSpace: ComplexTypeNamespaceT,
    ) => any;
    serializeEntity: <EntityT extends EntityBase>(
        entity: EntityT,
        entityApi: EntityApi<EntityT, any>,
        diff?: boolean,
    ) => Record<string, any>;
    serializeEntityNonCustomFields: <EntityT extends EntityBase>(
        entity: EntityT,
        entityApi: EntityApi<EntityT, any>,
    ) => Record<string, any>;
}

Properties

serializeComplexType: <
    ComplexTypeNamespaceT extends ComplexTypeNamespace<any> = any,
>(
    fieldValue: any,
    complexTypeNameSpace: ComplexTypeNamespaceT,
) => any

Method to serialize a complex type to JSON.

serializeEntity: <EntityT extends EntityBase>(
    entity: EntityT,
    entityApi: EntityApi<EntityT, any>,
    diff?: boolean,
) => Record<string, any>

Converts an instance of an entity class into a JSON payload to be sent to an OData service.

serializeEntityNonCustomFields: <EntityT extends EntityBase>(
    entity: EntityT,
    entityApi: EntityApi<EntityT, any>,
) => Record<string, any>

Like EntitySerializer#serializeEntity ignoring custom fields.

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