Skip to content

Metadata

Michael Dostál edited this page Nov 14, 2018 · 1 revision

Metadata such as links or data for pagination purposes can also be included in the result.

For each model a specific MetadataModel can be defined. To do this, the class name needs to be added in the ModelConfig.

If no MetadataModel is explicitly defined, the default one will be used, which contains an array of links and meta property.

@JsonApiModelConfig({
    type: 'deals',
    meta: JsonApiMetaModel
})
export class Deal extends JsonApiModel

An instance of a class provided in meta property will get the whole response in a constructor.

Clone this wiki locally