digia / jaysonapi

Node framework agnostic JSON API serializer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

meta

bidva opened this issue · comments

commented

How to add meta tag to collection ?

Hey @bidva, it's been a minute since I've worked with the library, but if I recall correctly passing meta to .serialize() will simply pass it through to the output.

const data = {};
const meta = {};

const jsonapi = YourSerializer.serialize({ data, meta });

// meta === jsonapi.meta

function serialize({ data, included, meta, links, errors } = {}) { // eslint-disable-line