Class JsonApiTransformer

Api request & response transformed based on the Jsona library.

Hierarchy

  • JsonApiTransformer

Implements

Index

Constructors

constructor

Properties

formatter

formatter: Jsona

Methods

deserialize

deserializeRecord

deserializeRecords

formatNestedRelations

  • formatNestedRelations(model: ModelClass, record: any): any
  • Since we need to send relationships aside with records, in order to update them, we need to transform their plain form representation, i.e.:

    { "id": 100, "organization": { "id": 10 } }

    To a JSON API compliant JSON, which requires all the related resources to be define in a relationship fields. Jsona may helps us here, but we need to convert the values, adding the type (based on Model) and registering them in the relationshipNames[] property.

    Parameters

    • model: ModelClass

      Current model

    • record: any

      Model record

    Returns any

serialize

serializeRecord

serializeRecords

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc