Class PolymorphicSerializer<PrimaryType>

The Serializer class is the main class used to serializer data (you can use the ErrorSerializer class to serialize errors).

Example:

[[include:serializer.example.ts]]

Type Parameters

Hierarchy (view full)

Constructors

Properties

cache: Cache<PrimaryType> = ...

Caching

collectionName: string

The name to use for the type.

helpers: Helpers<PrimaryType>

The set of helper functions for the serializer

key: keyof PrimaryType
serialisers: Record<string, Serializer<any>>
defaultOptions: {
    asIncluded: boolean;
    cache: boolean;
    depth: number;
    idKey: string;
    include: number;
    linkers: {};
    metaizers: {};
    nullData: boolean;
    onlyIdentifier: boolean;
    onlyRelationship: boolean;
    projection: null;
    version: string;
} = ...

Default options. Can be edited to change default options globally.

Type declaration

  • asIncluded: boolean
  • cache: boolean
  • depth: number
  • idKey: string
  • include: number
  • linkers: {}
    • metaizers: {}
      • nullData: boolean
      • onlyIdentifier: boolean
      • onlyRelationship: boolean
      • projection: null
      • version: string

      Methods

      Generated using TypeDoc