Skip to content

Relationships object #625

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

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update homepage, patch extension examples for new relationships object
  • Loading branch information
ethanresnick committed May 17, 2015
commit d7816185e76551b138daa6ba3f3638dd665a3358
10 changes: 5 additions & 5 deletions extensions/jsonpatch/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ or `null`, to remove the relationship.
For instance, the following request should update the `author` of an article:

```text
PATCH /article/1/links/author
PATCH /article/1/relationships/author
Content-Type: application/vnd.api+json; ext=jsonpatch
Accept: application/vnd.api+json; ext=jsonpatch

Expand All @@ -117,7 +117,7 @@ To remove a to-one relationship, perform a `replace` operation on the
relationship to change its value to `null`. For example:

```text
PATCH /article/1/links/author
PATCH /article/1/relationships/author
Content-Type: application/vnd.api+json; ext=jsonpatch
Accept: application/vnd.api+json; ext=jsonpatch

Expand All @@ -144,7 +144,7 @@ not allowed by the server.
For example, the following request replaces every tag for an article:

```text
PATCH /photos/1/links/tags
PATCH /photos/1/relationships/tags
Content-Type: application/vnd.api+json; ext=jsonpatch
Accept: application/vnd.api+json; ext=jsonpatch

Expand All @@ -168,7 +168,7 @@ In the following example, the comment with ID `123` is added to the list of
comments for the article with ID `1`:

```text
PATCH /articles/1/links/comments
PATCH /articles/1/relationships/comments
Content-Type: application/vnd.api+json; ext=jsonpatch
Accept: application/vnd.api+json; ext=jsonpatch

Expand All @@ -190,7 +190,7 @@ In the following example, comments with IDs of `5` and `13` are removed
from the list of comments for the article with ID `1`:

```text
PATCH /articles/1/links/comments
PATCH /articles/1/relationships/comments
Content-Type: application/vnd.api+json; ext=jsonpatch
Accept: application/vnd.api+json; ext=jsonpatch

Expand Down
18 changes: 12 additions & 6 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,27 @@ Here's an example response from a blog that implements JSON API:
"attributes": {
"title": "JSON API paints my bikeshed!"
},
"links": {
"self": "http://example.com/posts/1",
"relationships": {
"author": {
"self": "http://example.com/posts/1/links/author",
"related": "http://example.com/posts/1/author",
"links": {
"self": "http://example.com/posts/1/relationships/author",
"related": "http://example.com/posts/1/author"
},
"linkage": { "type": "people", "id": "9" }
},
"comments": {
"self": "http://example.com/posts/1/links/comments",
"related": "http://example.com/posts/1/comments",
"links": {
"self": "http://example.com/posts/1/relationships/comments",
"related": "http://example.com/posts/1/comments"
},
"linkage": [
{ "type": "comments", "id": "5" },
{ "type": "comments", "id": "12" }
]
}
},
"links": {
"self": "http://example.com/posts/1"
}
}],
"included": [{
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