Safe Haskell | None |
---|---|
Language | Haskell2010 |
Contains representations of the top-level JSON-API document structure.
- data Document a
- data ErrorDocument a = ErrorDocument {
- _error :: Error a
- _errorLinks :: Maybe Links
- _errorMeta :: Maybe Meta
- data Included
- mkDocument :: ResourcefulEntity a => [a] -> Maybe Links -> Maybe Meta -> Document a
- mkCompoundDocument :: ResourcefulEntity a => [a] -> Maybe Links -> Maybe Meta -> Included -> Document a
- mkIncludedResource :: ResourcefulEntity a => a -> Included
Documentation
The Document
type represents the top-level JSON-API requirement.
data
attribute - the resulting JSON may be either a singleton resource
or a list of resources. See Resource
for the construction.
For more information see: http://jsonapi.org/format/#document-top-level
data ErrorDocument a Source #
The ErrorDocument
type represents the alternative form of the top-level
JSON-API requirement.
error
attribute - a descriptive object encapsulating application-specific
error detail.
For more information see: http://jsonapi.org/format/#errors
ErrorDocument | |
|
Eq (ErrorDocument a) Source # | |
Show (ErrorDocument a) Source # | |
Generic (ErrorDocument a) Source # | |
ToJSON a => ToJSON (ErrorDocument a) Source # | |
FromJSON a => FromJSON (ErrorDocument a) Source # | |
type Rep (ErrorDocument a) Source # | |
The Included
type is an abstraction used to constrain the "included"
section of the Document to JSON serializable Resource objects while
enabling a heterogeneous list of Resource types.
No data constructors for this type are exported as we need to
constrain the Value
to a heterogeneous list of Resource types.
See mkIncludedResource
for creating Included
types.
mkDocument :: ResourcefulEntity a => [a] -> Maybe Links -> Maybe Meta -> Document a Source #
Constructor function for the Document data type.
See mkCompoundDocument
for constructing compound Document
including 'side-loaded' resources
mkCompoundDocument :: ResourcefulEntity a => [a] -> Maybe Links -> Maybe Meta -> Included -> Document a Source #
Constructor function for the Document data type.
See mkIncludedResource
for constructing the Included
type.
Supports building compound documents http://jsonapi.org/format/#document-compound-documents
mkIncludedResource :: ResourcefulEntity a => a -> Included Source #
Constructor function for the Document data type.
Supports building compound documents http://jsonapi.org/format/#document-compound-documents