Skip to content

JsonMapperMethods

@tsed/json-mapper

Usage

typescript
import { JsonMapperMethods } from "@tsed/json-mapper";

See /packages/specs/json-mapper/src/interfaces/JsonMapperMethods.ts.

Overview

ts
interface JsonMapperMethods {
    deserialize<T = any, C = any>(obj: any, ctx: JsonMapperCtx<T, C>): any;
    serialize(obj: any, ctx: JsonMapperCtx<any>): any;
}

Description

Contract implemented by every custom JSON mapper.

deserialize

ts
deserialize<T = any, C = any>(obj: any, ctx: JsonMapperCtx<T, C>): any;

Transform raw data into the target type or collection item.

serialize

ts
serialize(obj: any, ctx: JsonMapperCtx<any>): any;

Transform a runtime value into its serialized representation.

Released under the MIT License.