Drop-in serializer support for Express/Connect Node apps.
Renders the payload according to the JSONAPI 1.0 spec, including related resources, included records, and support for meta and links.
Take a payload (a model, an array of models, or an Error) and render it as a JSONAPI compliant document
the rendered JSONAPI document
Render the primary payload for a JSONAPI document (either a model or array of models).
errors or models to render
top level document to render into
Render any included records into the top level of the document
top level JSONAPI document
array of records to sideload
Render top level meta object for a document. Default uses meta supplied in options call to res.render().
top level JSONAPI document
Render top level links object for a document. Defaults to the links supplied in options to res.render().
top level JSONAPI document
Render the version of JSONAPI supported.
top level JSONAPI document
Render the supplied record as a resource object.
a resource object representing the record
Returns the JSONAPI attributes object representing this record's relationships
the JSONAPI attributes object
Returns the JSONAPI relationships object representing this record's relationships
the JSONAPI relationships object
Takes a relationship descriptor and the record it's for, and returns any links for that relationship for that record. I.e. '/books/1/author'
name of the relationship
descriptor for the relationship
parent record containing the relationships
the links object for the supplied relationship
Takes a relationship descriptor and a record it's for, and returns the data for that relationship. Also sideloads any included records in the top level included namespace.
name of the relationship
the related id(s) or record(s)
the user supplied relationship config
the parent record that holds this relationship
top level JSONAPI document
array of resource identifiers
Returns any meta for a given relationship and record. No meta included by default.
name of the relationship
descriptor for the relationship
parent record containing the relationship
Returns links for a particular record, i.e. self: "/books/1"
[description]
[description]
[description]
Returns meta for a particular record.
Sideloads a record into the top level "included" array
the record to sideload
the top level JSONAPI document
Render the supplied error
the JSONAPI error object
Given an error, return a JSON Pointer, a URL query param name, or other info indicating the source of the error.
an error source object, optionally including a "pointer" JSON Pointer or "parameter" for the query param that caused the error.
Return the meta for a given error object. You could use this for example, to return debug information in development environments.
Return a links object for an error. You could use this to link to a bug tracker report of the error, for example.
Remove duplicate entries from the sideloaded data.
the top level JSONAPI document