json-api-0.1.0.4: Utilities for generating JSON-API payloads

Safe HaskellNone
LanguageHaskell2010

Network.JSONApi.Resource

Description

Module representing a JSON-API resource object.

Specification: http://jsonapi.org/format/#document-resource-objects

Synopsis

Documentation

data Identifier Source #

Identifiers are used to encapsulate the minimum amount of information to uniquely identify a resource.

This object will be found at multiple levels of the JSON-API structure

Specification: http://jsonapi.org/format/#document-resource-identifier-objects

Constructors

Identifier 

Fields

data Resource a b Source #

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

Instances

(Eq a, Eq b) => Eq (Resource a b) Source # 

Methods

(==) :: Resource a b -> Resource a b -> Bool #

(/=) :: Resource a b -> Resource a b -> Bool #

(Show a, Show b) => Show (Resource a b) Source # 

Methods

showsPrec :: Int -> Resource a b -> ShowS #

show :: Resource a b -> String #

showList :: [Resource a b] -> ShowS #

Generic (Resource a b) Source # 

Associated Types

type Rep (Resource a b) :: * -> * #

Methods

from :: Resource a b -> Rep (Resource a b) x #

to :: Rep (Resource a b) x -> Resource a b #

(ToJSON a, ToJSON b) => ToJSON (Resource a b) Source # 

Methods

toJSON :: Resource a b -> Value #

toEncoding :: Resource a b -> Encoding #

(FromJSON a, FromJSON b) => FromJSON (Resource a b) Source # 

Methods

parseJSON :: Value -> Parser (Resource a b) #

type Rep (Resource a b) 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