A “resource identifier object” MUST contain member, whose value is a meta object that contains non-standard meta-information.To reduce the number of HTTP requests, servers MAY allow responses that include related resources along with the requested primary resources. In a compound document, all included resources MUST be represented as an array of resource objects in a top-level member.
Although the same media type is used for both request and response documents, certain aspects are only applicable to one or the other. Unless otherwise noted, objects defined by this specification MUST NOT contain any additional members.
Client and server implementations MUST ignore members not recognized by this specification.
If a client requests a restricted set of fields for a given resource type, an endpoint MUST NOT include additional fields in resource objects of that type in its response.
Note: This section applies to any endpoint that responds with resources as primary or included data, regardless of the request type.
The following “globally allowed characters” MAY be used anywhere in a member name: as the primary data (as described above). A server MAY include error details with error responses.
A server MUST prepare responses, and a client MUST interpret responses, in accordance with MUST be returned, as described above. A server MAY include error details with error responses.
A JSON object MUST be at the root of every JSON API request and response containing data. A document MUST contain at least one of the following top-level members: A logical collection of resources MUST be represented as an array, even if it only contains one item or is empty.
“Resource objects” appear in a JSON API document to represent resources.
A resource object MUST contain at least the following top-level members: member is not required when the resource object originates at the client and represents a new resource to be created on the server.
In addition, a resource object MAY contain any of these top-level members: key MUST be an object (an “attributes object”).
Additionally, a related resource link MUST NOT change because its relationship’s content changes.