Skip to content

convert non-normative note into constraint #434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 8, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions format/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,18 @@ 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:

* `"links"`: information about a resource's relationships (described
below).
* `"links"`: a "links object", providing information about a resource's
relationships (described below).
* `"meta"`: non-standard meta-information about a resource that can not be
represented as an attribute or relationship.

Any other top-level member in a resource object represents an "attribute".
An attribute may contain any valid JSON value.

> Note: Although has-one foreign keys are often stored as columns in a
database alongside other fields, foreign keys **MUST NOT** be included in a
resource's attributes. All relations **MUST** be represented under a
resource's links object, as described below.
Although has-one foreign keys (e.g. `author_id`) are often stored internally
alongside other information to be represented in a resource object, these keys
*SHOULD NOT* appear as attributes. If relations are provided, they **MUST**
be represented under the "links object", as described below.

Here's how an article (i.e. a resource of type "articles") might appear in a document:

Expand All @@ -156,7 +156,15 @@ Here's how an article (i.e. a resource of type "articles") might appear in a doc
{
"type": "articles",
"id": "1",
"title": "Rails is Omakase"
"title": "Rails is Omakase",
"links": {
"author": {
"self": "/articles/1/links/author",
"related": "/articles/1/author",
"type": "people",
"id": "9"
}
}
}
// ...
```
Expand Down Expand Up @@ -186,7 +194,7 @@ consistently throughout an implementation.
Each resource object **MUST** contain an `id` member, whose value **MUST**
be a string.

#### Links
#### Links <a href="#document-structure-links" id="document-structure-links" class="headerlink"></a>

The value of the `"links"` key is a JSON object (a "links object") that
represents related resources, keyed by the name of each association.
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy