View Source JSONAPIPlug.Document (jsonapi_plug v2.0.0)
JSON:API Document
This module defines the structure of a JSON:API
document and functions that handle
serialization and deserialization. This also handles validation of JSON:API
documents.
Summary
Types
JSON:API Primary Data
JSON:API Errors
JSON:API Included Resources
JSON:API Object
JSON:API Links
JSON:API Meta Information
JSON:API Document
Functions
Deserialize JSON:API Document
Serialize a Document struct representing a JSON:API Document
Types
@type data() :: JSONAPIPlug.Document.ResourceObject.t() | [JSONAPIPlug.Document.ResourceObject.t()]
JSON:API Primary Data
@type errors() :: [JSONAPIPlug.Document.ErrorObject.t()]
JSON:API Errors
@type included() :: [JSONAPIPlug.Document.ResourceObject.t()]
JSON:API Included Resources
@type jsonapi() :: JSONAPIPlug.Document.JSONAPIObject.t()
JSON:API Object
@type links() :: %{required(atom()) => JSONAPIPlug.Document.LinkObject.t()}
JSON:API Links
@type meta() :: payload()
JSON:API Meta Information
@type t() :: %JSONAPIPlug.Document{ data: JSONAPIPlug.Resource.t() | [JSONAPIPlug.Resource.t()] | nil, errors: errors() | nil, included: included() | nil, jsonapi: jsonapi() | nil, links: links() | nil, meta: meta() | nil }
JSON:API Document