Safe Haskell | None |
---|---|
Language | Haskell2010 |
Module representing a JSON-API resource object.
Specification: http://jsonapi.org/format/#document-resource-objects
- data Resource a = Resource {}
- data Relationships
- class (ToJSON a, FromJSON a) => ResourcefulEntity a where
- data Relationship
- mkRelationship :: Maybe Identifier -> Maybe Links -> Maybe Relationship
- mkRelationships :: Relationship -> Relationships
Documentation
Type representing a JSON-API resource object.
A Resource supplies standardized data and metadata about a resource.
Specification: http://jsonapi.org/format/#document-resource-objects
data Relationships Source #
class (ToJSON a, FromJSON a) => ResourcefulEntity a where Source #
A typeclass for decorating an entity with JSON API properties
resourceIdentifier :: a -> Text Source #
resourceType :: a -> Text Source #
resourceLinks :: a -> Maybe Links Source #
resourceMetaData :: a -> Maybe Meta Source #
resourceRelationships :: a -> Maybe Relationships Source #
fromResource :: Resource a -> a Source #
toResource :: a -> Resource a Source #
data Relationship Source #
A type representing the Relationship between 2 entities
A Relationship provides basic information for fetching further information about a related resource.
Specification: http://jsonapi.org/format/#document-resource-object-relationships
mkRelationship :: Maybe Identifier -> Maybe Links -> Maybe Relationship Source #
Constructor function for creating a Relationship record
A relationship must contain either an Identifier or a Links record