Forked from toddmohney/json-api
A Haskell API using JSON API should provide only Documents. Document is the top level type and all of the other types are included within a Document.
- The list of
Identifiers inRelationshipmust be unique, there is anEqconstraint to make sure it can remove duplications. - The self link (if it exists) in a Relationship should return all of the
Identifiers in thatRelationship. - A
Relationshipmust have a list ofIdentifiers and/orLinksbut both cannot be empty, that is why there is amkRelationshipfunction. Meta,Links,RelationshipsandIncludedmay all be empty. If they are empty the key will not exist in the JSON representation.- A
Documenthas at least oneResource. - Use
toDocumentandfromDocumentwhen making and receivingDocument. You can also usetoDocumentCompleteandfromDocumentCompleteif you needLinksandMeta. - If a
DocumenthasRelationshipsitstoJSONandfromJSONwill generally not commute becausetoJSONandfromJSONdo not know how to encodeRelationshipsdata from aResourceinto and fromdocRelationships. If you need to commute, derive and useDocumentEntity.